Skip to main content
Skip table of contents

Training module (SI): Validate your document through document checks and XML warnings

In this module, you will learn about document checks and XML warnings.

Tutorial

In the right-hand panel, Lawmaker provides a range of tabs relevant for editing and checking your document. For this module, two are relevant:

  • Document Checks - indications that something in your document has been drafted in a non-standard way

  • XML Warnings - technical issues with the underlying XML language in your document

This module will not cover everything you could possibly encounter in these two tabs; rather, it should give you an idea of how to use these tabs to check your document before you need to send it for registration.

Document Checks

Document checks occur when something in your document has been flagged as being drafted in a non-standard way.

Generally, they are divided into two groups:

  • Advisory - issues that are advisable to fix but will not cause registration issues; and

  • Mandatory - issues that are likely to cause registration issues.

Some warnings contain automatic fixes. For example, if some provisions have leading or trailing spaces - i.e. extra blank spaces - you can remove these by clicking the option within the warning.

Generally, warnings should contain sufficient information to fix the issue by yourself. See further information below for a link to information on some common document warnings.

XML Warnings

XML warnings indicate that something is incorrect within the XML structure of your document.

For example, if a ‘Content’ element contains a ‘Regulation’ element, this would be invalid structure and would trigger a warning.

This will likely cause issues with registration, and can also be problematic for PDF generation.

Therefore it is important to get XML errors fixed as early as possible.

Some XML warnings will include an option to automatically fix the issue. Note however that this may involve simply deleting the provision in which it has occurred.

If you have XML errors in your document, and these cannot be fixed using the inbuilt options or by redrafting the affected area, please contact the Service portal.

Hopefully, XML warnings won’t appear in your document as Lawmaker is set up to avoid them when you draft normally. Occasionally they could occur, e.g., through copy-and-paste operations.

Video

Please watch the following video to consolidate the above.

It comprises:

  • Document checks (0:05)

  • XML Warnings (2:38)

https://youtu.be/YQmeBwGo5WI

Further information


(Optional:) Exercises

If you are pressed for time, it is sufficient to be aware of the concepts of Document checks and XML Warnings to complete this module.

However, if you want practice in resolving some of these checks, see the exercises below.

Getting started

For these exercises, you will need to be logged into the Training environment for Lawmaker (link here). If you already have a project with subtype Regulations, you can use this. Otherwise create a new project (see instructions in the expandable section below).

You should begin by uploading one of the documents below, as relevant for the type of document you are working with:

(The content of these secondary instruments may not be realistic for your document type.)

For detailed instructions, see the expandable section below.

Instructions to create a project and upload a document
  1. Log in to the Lawmaker Training environment (link here).

  2. From the Dashboard, create a new project. (See Creating a new project for details.)
    Select the document type that you are most likely to work with. For Sub-type, select Regulations (for convenience).
    Give it a memorable title such as[Your name] - Training project - Document Checks

  3. From the Project tab for your new document, select Document Actions > Upload document. Give the document a clear Version Description, e.g., the name of this Training module.

  4. Click Choose File and upload the relevant XML document attached above.

  5. Click Upload.

  6. Open the new document in the Editor.

Exercise 1 - Fix the “Advisory: The body of the document is not divided into an even hierarchical structure… [etc.]” warning

Before doing this exercise, ensure you have read the page The body of the document is not divided into an even hierarchical structure. This is because not all provisions in the body are wrapped in the same kind of grouping provision (e.g. a Part).

Your document should contain a warning with the text:

Advisory: The body of the document is not divided into an even hierarchical structure. This is because not all provisions in the body are wrapped in the same kind of grouping provision (e.g. a Part). To fix, select the provisions that are not in the group and drag them (one by one) into an existing group.

Review your document to identify the cause of this warning, then fix it.

Instructions to fix "Advisory: The body of the document is not divided into an even hierarchical structure…” warning

This warning has appeared because parts of the document are not included in the grouping provisions used throughout the document, i.e., Parts, making the document unevenly structured.

  1. Go to the Structure view on the left-hand side of the screen;

  2. Identify the provisions that are outside of their required locations, and the grouping provisions that they should be contained within.

    • In this case, there are four Regulations which are supposed to be in Part 3, but are actually outside of it:

      image-20260309-165410.png
  3. To fix: in the Structure View, click on the first provision you need to move within Part 3, e.g., “1. Payment of the levy”. It should appear highlighted.

  4. Click again and hold, then drag it to the correct position, i.e. under “Part 3 Payment”.

    1. A green arrow should appear next to Payment to show that you can drop it there.

  5. Let go of the provision to drop it in the correct location.

  6. Repeat for the other provisions that need moving.

  7. Check the order of the provisions that have been moved, as they may be out of order, depending on which order you moved them in.
    If so, reorder them using the structure view (see steps 3.-5. above).

  8. You may also need to renumber the document. Do do this, press Alt + N and select Whole document when asked.

Exercise 2 - Fix “The legislative document relating to external reference… could not be located… [etc.]” warnings

Before doing this exercise, see The legislative document relating to the external reference _______ could not be located on Legislation.gov.uk . This may be because the document doesn't exist yet or because there is a typo in the name. .

You should have four warnings in your document of this type, referring to the definition for “offshore exploration licence” in Regulation 2.

Identify the cause of these warnings and fix them.

Hint: the reference is intended to link to this piece of legislation.

Instructions to fix “The legislative document relating to external reference… could not be located… [etc.]” warnings

This warning arises because Lawmaker doesn’t recognise the title of the legislation referred to in this provision. Specifically, this is due to a small typo.

To fix:

  1. Remove the reference tags by double clicking on any of the failed references here and selecting Remove tag. (All of the distinct references to “regulation 2(2)(a)” and the Regulations as a whole should be removed.)

  2. Compare the typed reference to the title on legislation.gov.uk. The small typo is that after the word “Petroleum”, there should be a comma.

    • Add a comma to correct the title so that it reads “the Offshore Exploration (Petroleum, and Gas Storage and Unloading) (Model Clauses) Regulations 2009”.

  3. Go to the breadcrumb at the bottom of the screen and select Definition to highlight the definition of “offshore production licence”.

  4. Press Alt+T to tag the reference.

The reference should now tag successfully, without triggering the warnings.

Exercise 3 - Fix “Mandatory: The SI's title could not be found in the first provision.”

Your document should contain a warning with the text:

Mandatory: The SI's title could not be found in the first provision.

Review your document to find the cause of this document warning and fix the issue.

Instructions to fix “Mandatory: The SI's title could not be found in the first provision.”

This issue is caused by another small typo. In Regulation 1. –(1), the title of the Regulations provided contains the text “(Levy & Fees)”, when it should be “(Levy and Fees)”, with “and” instead of “&”.

To fix this issue, simply correct “&” to “and”.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.