Lists Home |
Date Index |
> -----Original Message-----
> From: John Cowan [mailto:email@example.com]
> Sent: Friday, June 21, 2002 2:46 PM
> To: Dare Obasanjo
> Cc: John Cowan; Rick Taylor; firstname.lastname@example.org
> Subject: Re: [xml-dev] XML Schema to relaxNG xslt
> > does RELAX NG mimic restrictions (especially the nested ones) that
> > involve facets like xs:minInclusive, xs:maxInclusive?
> RNG can specify constraints on simple types,
RELAX NG can specify pattern constraints but I haven't seen the ability
to specify ranges which is what xs:minInclusive, xs:maxInclusive et al
do. Can I specify a type that is a date between 1990 and 2000 or a time
between 9:00AM and 5:00 PM in RELAX NG?
On looking at the tutorial it seems this could be done if a RELAX NG
implementation supported the W3C XML Schema Datatypes recommendation as
a type library and implemented the facets as datatype parameters.
However I don't see anything that implies that an implementation with
such functionality exists or is forthcoming.
> but not nested constraints.
> How does one restrict complex types in WXS?
A restriction of a complex type is a type that validates a subset of
what the base type does. An example is
<!-- base type -->
<xs:element name="numPosts" type="xs:integer" minOccurs="0"
<xs:element name="signature" type="xs:string" nillable="true" />
<xs:attribute name="firstSubscribed" type="xs:date" use="required" />
<xs:attribute name="mailReader" type="xs:string"/>
<!-- derived type -->
<xs:element name="numPosts" type="xs:integer" minOccurs="1" />
<xs:element name="signature" type="xs:string" nillable="false" />
<xs:attribute name="firstSubscribed" type="xs:date" use="optional" />
<xs:attribute name="mailReader" type="xs:string" fixed="Microsoft
> In the spec:
>Section 4.7, 3rd paragraph.
Funny enough I found the language in the spec as hard to parse as when I
first started reading the
W3C XML Schema Structures recommendation less than a year ago.
>In the tutorial:
Ahhh, much better. Too bad W3C XML Schema Primer doesn't do as complete
a job as the RELAX NG tutorial.
PITHY WORDS OF WISDOM
No one wants constructive criticism. It's all we can do to put up with
This posting is provided "AS IS" with no warranties, and confers no