Try OpenEdge Now
skip to main content
Working with XML
Reading and Writing XML with the Document Object Model (DOM) : Validation
 

Validation

You can validate XML against a DTD or an XML Schema file. The DOM parser will always validate against an internal DTD or DTD reference. In addition, the SCHEMA-PATH attribute of the X-document allows you to point to another DTD for validation.
If you would like to validate against one or more XML Schema files, you can specify the location of these in the SCHEMA-LOCATION attribute or the NONAMESPACE-SCHEMA LOCATION attribute. The following table describes the attributes and method that you configure to set up validation.
Table 3. X-document support for XML Schema validation
X-document attribute or method
Description
SCHEMA-LOCATION attribute
Determines the list of namespace/location pairs of an XML Schema document to validate against.
NONAMESPACE-SCHEMA-LOCATION attribute
Determines the location the XML Schema document to validate against when elements do not contain a namespace.
ADD-SCHEMA-LOCATION( ) method
An XML Schema document location is specified by providing a pair of values: a namespace and a physical location. This method allows you to specify that value pair and add it to the list of pairs stored in the SCHEMA-LOCATION attribute. The XML Schema documents listed in this attribute are used by an X-document to validate XML content.
For more information, see the reference entries for these methods and attributes in OpenEdge Development: ABL Reference.