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

RE: XML Schema to relaxNG xslt

  • To: "John Cowan" <jcowan@r...>
  • Subject: RE: XML Schema to relaxNG xslt
  • From: "Dare Obasanjo" <dareo@m...>
  • Date: Sat, 22 Jun 2002 11:19:21 -0700
  • Cc: "Rick Taylor" <taylor@p...>,<xml-dev@l...>
  • Thread-index: AcIZbTI0Kc+3Rg9wR+ykjxhLJ68GMgAp2q9Q
  • Thread-topic: XML Schema to relaxNG xslt

relax ng xslt
> -----Original Message-----
> From: John Cowan [mailto:jcowan@r...] 
> Sent: Friday, June 21, 2002 2:46 PM
> To: Dare Obasanjo
> Cc: John Cowan; Rick Taylor; xml-dev@l...
> Subject: Re:  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. 

Thought so. 

> 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 

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">

 <!-- base type -->
 <xs:complexType name="XML-Deviant">
  <xs:sequence>
   <xs:element name="numPosts" type="xs:integer" minOccurs="0"
maxOccurs="1" /> 
   <xs:element name="signature" type="xs:string" nillable="true" />
  </xs:sequence>
  <xs:attribute name="firstSubscribed" type="xs:date" use="required" />
  <xs:attribute name="mailReader" type="xs:string"/>
 </xs:complexType>



 <!-- derived type --> 
  <xs:complexType name="DareObasanjo">
   <xs:complexContent>
   <xs:restriction base="XML-Deviant">
   <xs:sequence>
    <xs:element name="numPosts" type="xs:integer" minOccurs="1" /> 
    <xs:element name="signature" type="xs:string" nillable="false" />
   </xs:sequence>
   <xs:attribute name="firstSubscribed" type="xs:date" use="optional" />
   <xs:attribute name="mailReader" type="xs:string" fixed="Microsoft
Outlook" />
   </xs:restriction>
   </xs:complexContent>
  </xs:complexType> 


</xs:schema>

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

>In the tutorial:
>
>http://www.oasis-open.org/committees/relax-ng/tutorial-20011203.html#ID
A3PZR

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

This posting is provided "AS IS" with no warranties, and confers no
rights. 



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.