Layering Schemas

When considering the schema language that's appropriate for your needs, the following questions may help you decide.

  • Do you need to constrain element and attribute structures? If so, choose DTDs, the W3C XML Schema Language, or RELAX NG.

  • Do you need to define entities? If so, you'll need a DTD.

  • Do you need broad compatibility with existing software and systems? Choose DTDs.

  • Do you need a simple, human-authorable syntax? Choose RELAX NG.

  • Do you need to annotate elements and attributes, either with types or other information? If so, the W3C XML Schema Language is powerful.

  • Do you need to store the schema documents independent of the instance documents? Choose the W3C XML Schema Language, Schematron, or RELAX NG.

  • Do you need co-occurrence ...

Get Effective XML: 50 Specific Ways to Improve Your XML now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.