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

Re: Can XML Schema be compiled to Schematron?


pwrm.com
Hi,

Doug Ransom wrote:

> I have been thinking that it would be an interesting exercise to 
> implement a compiler that transforms XML Schema into Schematron 
> (probably in XSLT). 
> 
> Is there any reason why this will not work?
> 
My guess is that it could work for a vast majority of schemas but 

fail for those schemas which are not fully determined at 

"compile time".


W3C XML Schema lets you use wildcards which are still validated, for 
instance when you write:

<xs:all namespace="##other" processContents="strict"/>

When such wildcards are used, a schema validator needs to retrieve the 
schema matching the namespace of elements which will be found in the 
instance document and the list of possible namespace isn't closed.

When you combine this feature with a mechanism of schema "discovery" 
(RDDL or simple namespace URI dereferencing), you've got a situation 
where the schema cannot be fully "compiled" before the instance document 
is read (and the list of namespaces actually used by wildcard elements 
is known) and this seems impossible to implement with a straight "batch" 
compilation process.

Fortunately, dynamic schema "discovery" isn't mandatory and this is 
something which you can probably just drop from your list of features, 
but I have thought it was something to be aware of ;=) ...

Eric



> 
> Doug Ransom
> Internet Technologies Domain Lead
> Power Measurement http://www.pwrm.com <http://www.pwrm.com/>
> mailto:Doug.Ransom@p...
> 
>  
> 



-- 
Rendez-vous a Paris pour les Electronic Business Days 2002.
                                   http://www.edifrance.org/ebd/index.htm
------------------------------------------------------------------------
Eric van der Vlist       http://xmlfr.org            http://dyomedea.com
http://xsltunit.org      http://4xt.org           http://examplotron.org
------------------------------------------------------------------------


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.