[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]
Four things that I've recently learned
- From: "Costello, Roger L." <costello@mitre.org>
- To: <xml-dev@lists.xml.org>
- Date: Wed, 7 May 2008 14:50:43 -0400
Hi Folks,
1. Use the right schema language for the right job.
2. It's the XML vocabulary that matters, not the particular schema
language used to implement the vocabulary.
3. Create a metaschema that abstracts away the schema language
implementations, thus enabling applications to focus on processing the
XML vocabularies, and not worrying about the particular schema
languages they're implemented in.
4. Multiple validations on the data should be the norm, not the
exception.
For details on each of these, scroll down ...
1. Use the right schema language for the right job.
XML Schema and Relax NG are two schema languages for expressing
grammar-based rules. They are both standards, the former a W3C
standard, the later an ISO standard. Although their capabilities are
largely overlapping, there are important differences. "Use the right
tool for the right job" is an adage that applies to choosing a schema
language. Knowing the differences in capabilities is crucial to making
a good decision in choosing a schema language.
2. It's the XML vocabulary that matters, not the particular schema
language used to implement it.
What matters is the XML vocabulary, not how it's implemented.
Example: what is important is that you've specified the syntax and
semantics (and possibly behavior) of these elements:
<Book>, <Title>, <Author>, <Date>, <ISBN>, <Publisher>
It's not important that you've specified the XML vocabulary using XML
Schema, Relax NG, or even DTD.
3. Create a metaschema that abstracts away the schema language
implementations, thus enabling applications to focus on processing the
XML vocabularies, and not worrying about the particular schema
languages they're implemented in.
Design your data as components that can be assembled, like Lego pieces,
into instance documents, and use NVDL as a metaschema for specifying
the assembled components.
4. Multiple validations on the data should be the norm, not the
exception.
Also known as "concurrent validation." Grammar-based validation using
XML Schema or Relax NG is rarely (if ever) sufficient for checking all
your data constraints. Rule-based validation, using Schematron, is
typically needed for checking co-constraints, cardinality checks, and
algorithmic checks. The tandem of a grammar-based validation and
Schematron validation should be the norm.
Comments?
/Roger
[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]