Next / Previous / Contents / TCC Help System / NM Tech homepage

5.3. Validation commands

Normally, as soon as emacs associates your document with a schema, nxml-mode constantly validates your document against the schema with every keystroke.

If validation is in effect and your document is not valid against the schema, the point where the document becomes invalid is shown with thin red underlining.

These commands will assist you in validating the document:

C-c C-n

Move to the next location where the document structure is not valid. If the document isn't valid, the cursor will jump to the probable error, and display a message in the minibuffer explaining what it doesn't like.

If the document is valid from the cursor to the end of the file, the message “No more errors” appears in the minibuffer.

To validate the entire document, move to the top of the document with M-< and then use this key sequence. If it says “No more errors” with point at the top of the file, the entire file is valid; otherwise it will jump the cursor to the next invalid content.

C-c C-v Turn validation on or off. If validation is turned on, in the status line's mode area you will see either “nXML Valid” or “nXML Invalid”. If validation is turned off, neither word will appear after “nXML” in the mode line. You may want to turn validation off during serious document surgery, then turn it back on when you think it's valid again.