validate command


validate [id] or validate DTD PUBLIC expression [SYSTEM filename] id or validate (DTD|RelaxNG|XSD) FILE filename [id] or validate (DTD|RelaxNG|XSD) STRING filename [id] or validate (RelaxNG|XSD) DOC id [id]


This command validates the document identified with id against a DTD, RelaxNG or XSD schema and report all validity errors. If no document identifier is given, the current document is used. A DTD can be specified either by its PUBLIC or SYSTEM identifier (or both), or as a STRING. RelaxNG and XSD schemas can be specified either as a filename or url (FILE filename), as a string (STRING expression), or as a XSH document (DOC id). If no schema is specified, validation is performed against the internal or external DTD subset of the document being validated.

Example 1.

open mydoc="test.xml"
# in all examples below, mydoc can be ommited
validate mydoc; # validate against the documet's DOCTYPE
validate DTD PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" mydoc
validate DTD SYSTEM "" mydoc
validate DTD FILE "" mydoc

Example 2.

validate RelaxNG FILE "test.rng" mydoc
validate RelaxNG STRING $relaxschema mydoc
open rng="test.rng"
validate RelaxNG DOC rng mydoc

Example 3.

validate XSD FILE "test.xsd" mydoc
validate XSD STRING $xsdschema mydoc
open xsd="test.xsd"
validate XSD DOC xsd mydoc

See Also

valid, dtd


Retrieving more information