[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]
RE: [xml-dev] Is Schematron (using XPath 2.0) functionally a superset of XML Schemas?
- From: "Michael Kay" <mike@saxonica.com>
- To: "'Costello, Roger L.'" <costello@mitre.org>,<xml-dev@lists.xml.org>
- Date: Sun, 11 Nov 2007 15:22:04 -0000
> > Since one of the major goals and benefits of Schematron is good
> > diagnostics, reducing a content model to a regular
> expression doesn't
> > seem a particularly smart idea.
>
> The example below shows Schematron expressing data
> requirements in a much more elegant and natural fashion than
> XML Schemas.
(1) you make it look as if you are answering my point. My point was about
content models, that is, constraints on the sequence of element children,
whereas your example has nothing to do with content models at all.
(2) your XSDL solution to the problem you have set yourself is a very poor
one. I would do it like this:
<element name="latitude">
<simpleType>
<restriction base="decimal">
<minInclusive value="-90"/>
<maxInclusive value="+90"/>
<pattern value=".*\.[0-9]{6}"/>
</restriction>
</simpleType>
</element>
(3) I don't think it's a good document design anyway. I cannot think of any
legitimate reason for imposing the artificial restriction that the XML
author should write 90.0 as 90.000000.
There are many criticisms one can make of XML Schema, but I think it handles
this particular requirement perfectly well.
Michael Kay
http://www.saxonica.com/
[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]