0

I am trying to grasp the principle of XML validation. There is a point I didn't get yet : what is the process which is responsible of actually validating the XML document against its specified XSD (or DTD) definition ?

I would like to know whether this is by default provided with the OS, or it is done by the editor we use (such as Oxygen IDE)? Thanks for your helpful clarifications.

01alm
  • 3
  • 3

3 Answers3

0

I would like to know whether

this is by default provided with the OS,

No.

or it is done by the editor we use (such as Oxygen IDE)?

Also no.

It is done by a validating XML processor.
(Which can, of course, be integrated in an IDE like Oxygen).
One validating XML/XSLT processor is the commercial edition of Saxon: SAXON EE:

The commercial Enterprise Edition from Saxonica, supporting XSLT 3.0, XPath 2.0 and 3.1, XQuery 3.1, XML Schema 1.0 and 1.1, and XQuery Update 1.0.

Another possibility is using Xerces, an Open Source validating parser described in this SO answer

zx485
  • 28,498
  • 28
  • 50
  • 59
0

Oxygen uses the Apache Xerces/J (Java) XML suite for parsing and validating XML against DTDs or XSDs (see eg. https://www.oxygenxml.com/forum/topic15534.html). Most probably, Apache Xerces is heavily customized and extended with additional JAXP components for use within Oxygen, such as needed for DTD and XSD metadata for interactive editing, and for validating against RNG, etc.

imhotap
  • 2,275
  • 1
  • 8
  • 16
0

In the case of DTD validation, the validation process is always closely associated with XML parsing; many XML parsers have an option to switch validation on or off, and if it is switched on, the parser will retrieve the DTD and validate the instance against it, typically "on the fly" during the parsing process.

XML parsers might come with your programming language (e.g. Java, C#, Python), or they may be free-standing third-party libraries. Some might be bundled with an operating system, but they aren't really part of the operating system.

In the case of XSD schema validation, the validator might be bundled as part of an XML parser as above, or it might be a separate component. So the parser might have an option to invoke schema validation on-the-fly during parsing, or there might be a free-standing validation utility. For example, in the Java world, the Xerces parser has options to invoke XSD validation, but there is also a schema validator in Saxon, which includes XSLT and XQuery processing but does not itself do XML parsing.

Interactive development environments ("editors") such as oXygen and Altova XMLSpy typically include an XSD schema validator; this might be one they have developed themselves (Altova) or a third-party product that they have integrated (oXygen allows you to choose between the Xerces and Saxon validators).

Michael Kay
  • 156,231
  • 11
  • 92
  • 164