OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Re: [xml-dev] XML Schema to relaxNG xslt

[ Lists Home | Date Index | Thread Index ]

Dare Obasanjo scripsit:

> 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.

Just so:  xsd:date params { minInclusive = "1990" maxInclusive = "2000" }

> However I don't see anything that implies that an implementation with
> such functionality exists or is forthcoming. 

The Jing and Sun Multi-Schema validators both handle xSD datatypes,
so we can say that they are handled de facto if not de jure.
The schemas I write routinely assume them, and in fact the latest
version of the compact syntax quietly declares "xsd" for you.

> > but not nested  constraints. 
> 
> Thought so. 

Actually, I figured out how this could be done, although I can't
think of a clear use case for it.  But abstractly, if you have
a type "foo" that is integers >= 1 and <= 1000, thus:

foo = xsd:integer params { minInclusive = "1" maxInclusive = "1000" }

then you can declare a subtype "bar" which has an inclusive upper bound of
100 thus:

bar = foo - xsd:integer params { minExclusive = 100 }

which is read "foo's except for integers with exclusive lower bound 100".
Because the specification is inside a negation, we need to change the
maxInclusive to a minExclusive.

> > 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.  

I grasp that.  Is it necessary to redeclare all the components of the
type, or only those which are changing?  And how do we say that a
component is not found in the subtype at all (maxOccurs = "0", maybe?)

> > In the spec:  
> >
> http://www.oasis-open.org/committees/relax-ng/spec-20011203.html#IDAG3YR
> >
> >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. 

I agree: the spec is quite difficult.  It is the equivalent of
the (not yet cooked) formal model, not the schema.


-- 
John Cowan <jcowan@reutershealth.com>     http://www.reutershealth.com
I amar prestar aen, han mathon ne nen,    http://www.ccil.org/~cowan
han mathon ne chae, a han noston ne 'wilith.  --Galadriel, _LOTR:FOTR_




 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS