[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: XML Schema to relaxNG xslt


xml mininclusive
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@r...>     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_

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.