Skip to main content
Skip table of contents

Training Module: Using document checks to validate your document

As you draft your document, there are a set of validation rules being applied to check the document is correct. These rules check both that the underlying XML is valid (and therefore the document can successfully be published downstream) and they also pick up some more general drafting and formatting issues.

📘 Introduction

Document checks - validating your document

📚 Exercises

🛠️ Getting Started

Before you can complete this exercise, you will need your own training project containing a bill with document check errors.
If you haven’t got one already, create a project containing this bill containing various document check errors: Document_Check_Errors.xml

If you already have a training project, start from step 4 in the instructions below.
The following steps will allow you to create the data required for this exercise.

How to create a new project
  1. Download the XML document for the exercise by clicking on the link you’ve been provided with. By default, the downloaded file is usually placed in the “downloads” folder on your computer.

  2. Log in to Lawmaker.

  3. From the Dashboard, create a new project of the type you need for the exercise. Give it a title such as [Your Initials] Drafting a bill. (See Creating a new project.)

  4. From the Project tab for that project, select Document Actions > Upload document, and select the XML file for the exercise which you have downloaded. It can be uploaded into the default folder that has been created in the project. (See Create a new document by uploading an XML file.)

  5. On the newly uploaded document version, select Actions > Update Document Information and update the Title to match the title you originally gave the project.

  6. Open the imported version in the Editor

✏️ Exercise 1: Fix your document check errors

This exercise will show you how you can fix document check errors.

The document we’re using for this exercise has a good selection of document check warnings that will need reviewing before the document is fit for sharing/publishing.

Getting started
  1. Find the document named Document Check Errors and open it in the Editor

  2. View the Document Checks right-hand panel

Step 1: Address ‘The part is not divided into an even hierarchical structure’ and ‘part number'

The document is currently divided into 1 part only which isn’t a valid structure for a finished document. If you are still drafting the document you can safely ignore this document check. To fix the document check error, restructure your document so that the content is evenly divided. In this case, the simplest thing would be to remove the part and cross heading using Unwrap Elements.

Additionally, there is another document check warning that the part is incorrectly numbered. Both of these will be fixed with the following actions—

Detailed instructions how to remove part and cross heading to fix the document check errors
  1. Place your cursor in the Part heading, right-click and select Unwrap Element. This will also fix the document check error “The number of this part should be Part 1 or Part A” and the document check count will go from 9 to 8

  2. Place your cursor in the cross heading, right-click and select Unwrap Element. This will fix the document check error 'The part is not divided into an even hierarchical structure’ and the document check count will go down from 8 to 7

Step 2: Address ‘Both start and end quotation marks have been set to none'

Clicking on this document check will jump to the offending quoted structure. It is missing a start and end tag. There is a ‘quick fix’ link which will automatically resolve the issue—

Detailed instructions how to fix missing quotation marks on quoted structures
  1. Click on the link ‘Add opening and closing double quotes’

  2. This will fix the document check 'Both start and end quotation marks have been set to none' and the document check count will go down from 7 to 6

Step 3: Address ‘there is a space at the end of the text'

Clicking on this document check will jump to the offending provision. There are other document check errors with similar warnings: space at the end of the text and space at the beginning of the text. There are also ‘quick fix’ links which will automatically resolve the issues. However, as there are a few, it’s quicker to use the single ‘remove space’ action—

Detailed instructions how to remove unwanted spaces at the beginning and end of provisions
  1. Select Tools > Remove all leading and trailing spaces

  2. This will fix all the space issues and report how many there were. The document check count will go down from 6 to 2

Step 4: Address ‘Definitions are usually in alphabetical order'

This is purely advisory and not mandatory to fix. The easy fix would be to rearrange them in alphabetical order, but sometimes it makes more sense to leave them in a particular order which isn’t alphabetical.

On this occasion just delete the subsection with the definitions as they clearly are not relevant to the bill—

Detailed instructions how to remove unwanted definitions
  1. Place your cursor into section 4(5)

  2. Select Subsection using the breadcrumb and delete

  3. This will fix the ‘Definitions are usually in alphabetical order’ document check and the count will go from 2 to 1

Step 5: Address ‘The target of internal reference cannot be found'

This document check appears when an existing cross reference has been broken e.g. the target provision has been deleted; or it can appear after automatic tagging of cross references where Lawmaker recognises it to be a cross reference but is unable to find the corresponding provision.

In this case, Lawmaker’s automatic tagging has created a false positive match: subsection (1) in this context refers to section 126 in the Local Government Act and not in this particular section in the document. You could remove the tag, but if you were likely to run another automatic tag on this provision in future, the same issue would reoccur. The best option would be to mark as ignored which will stop Lawmaker incorrectly marking it up as an internal reference again.

Detailed instructions how to fix a broken internal reference
  1. Click on the document check card to jump to the broken cross reference

  2. Double-click on this reference to get the hover toolbar

  3. Click on Mark as ignored

  4. This will fix the ‘The target of internal reference cannot be found’ document check and the count will go from 1 to none.


✏️ Exercise 2: View XML warnings

This exercise will show you how to view XML warnings.

Open the XML Warnings in the right-hand panel. The document you are using for this test does not have any XML warnings. If you did encounter an error in this panel that you can’t readily resolve (e.g. by clicking Undo or by renumbering the document) then raise a support request and the support team will help fix the issue.


☑️ When complete…

Save your changes and close the Editor using the Close Editor button

JavaScript errors detected

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

If this problem persists, please contact our support.