vertual avatar dating rooms - Java validating xml against schema

W3C XML Schema is complex and hard to learn, although that's partially because it tries to do more than mere validation (see PSVI).

Although being written in XML is an advantage, it is also a disadvantage in some ways.

W3C XML Schema has a rich "simple type" system built in (xs:number, xs:date, etc., plus derivation of custom types), while RELAX NG has an extremely simplistic one because it's meant to use type libraries developed independently of RELAX NG, rather than grow its own. In practice it's common for a RELAX NG schema to use the predefined "simple types" and "restrictions" (pattern, max Length, etc.) of W3C XML Schema.

In W3C XML Schema a specific number or range of repetitions of patterns can be expressed whereas it's practically not possible to specify at all in RELAX NG ().

RELAX NG has no ability to apply default attribute data to an element's list of attributes (i.e., changing the XML info set), while W3C XML Schema does.

Again, this design is intentional and is to separate validation and augmentation.

XSD schemas are conventionally written as XML documents, so familiar editing and transformation tools can be used.

As well as validation, XSD allows XML instances to be annotated with type information (the Post-Schema-Validation Infoset (PSVI)) which is designed to make manipulation of the XML instance easier in application programs.

There are languages developed specifically to express XML schemas.

The Document Type Definition (DTD) language, which is native to the XML specification, is a schema language that is of relatively limited capability, but that also has other uses in XML aside from the expression of schemas.

The W3C XML Schema language in particular can be quite verbose, while a DTD can be terse and relatively easily editable.

Tags: , ,