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] Can XML Schema be compiled to Schematron?

[ Lists Home | Date Index | Thread Index ]

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@pwrm.com
> 
>  
> 



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





 

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

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