Altova Mailing List Archives

XML Schema: restricted ?

From: Scott Lamb <slamb@-----.--->
To: xml-dev@-----.---.---
Date: 5/4/2003 6:11:00 AM
I'm writing something similar to Cocoon's XSP (called XFP, for the 
moment). I'd like to make an XML Schema for validation purposes. The 
problem I've run into is dealing with non-XFP elements. I'd like to be 
able to embed arbitrary elements that aren't specified in my schema, 
but I'd still like to have some control over their content. Ideally, 
I'd be able to do something like this:

   <xs:element id="other" namespace="##other" mixed="yes">
         <xs:element ref="xfp:attribute" minOccurs="0" 
         <xs:choose minOccurs="0" maxOccurs="unbounded">
           <xs:element ref="xfp:element"/>
           <xs:element ref="xfp:logic"/>
           <xs:element ref="xfp:expr"/>
           <xs:element ref="other"/>

In other words, I'd like to be able to say that xfp:attribute always 
has to precede other children of stuff in random namespaces. That kind 
of thing. From the W3C specs, it doesn't appear that either 
<xs:element> or <xs:any> support this kind of thing.

Is there any way to do this?

Alternatively, is there a XML Schema for Cocoon's XSP available? I'm 
sure they've had to solve this same problem.

Scott Lamb


These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.