The Extensible Markup Language (XML) and Java technology are natural partners in helping developers exchange data and programs across the Internet.
That's because XML has emerged as the standard for exchanging data across disparate systems, and Java technology provides a platform for building portable applications.
In the code example that follows, a schema-validating Xml Reader validates the XML data loaded into the DOM. Schema Class Xml Document Validation Example Shared Sub Main() Try ' Create a schema validating Xml Reader. Validation Event Handler, New Validation Event Handler(Address Of Validation Event Handler) settings. Select Single Node("/bk:bookstore/bk:book/bk:price", manager) Console.
Two more expressive XML schema languages in widespread use are XML Schema (with a capital S) and RELAX NG.
The mechanism for associating an XML document with a schema varies according to the schema language.
Java developers can invoke a SAX or DOM parser in an application through the JAXP API to parse an XML document -- that is, scan the document and logically break it up into discrete pieces.
The parsed content is then made available to the application.
The Xml Document class does not validate the XML in the Document Object Model (DOM) against an XML Schema definition language (XSD) schema or document type definition (DTD) by default; the XML is only verified to be well-formed.