[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: XHTML m12n XSD
- From: "Arnold, Curt" <Curt.Arnold@hyprotech.com>
- To: "'xml-dev@xml.org'" <xml-dev@xml.org>
- Date: Thu, 04 Jan 2001 15:54:53 -0700
This would seem to be a place where you could use substitution groups or the any construct.
Basically, in the schema that defines block, you would do something like:
<!-- this element can't be instantiated but provides a placeholder for
other schemas to nominate elements that fit here -->
<xsd:element name="blockExtra" abstract="true" type="urType"/>
<xsd:element name="block">
<xsd:sequence>
<!-- add a reference to the abstract element whereever
you will allow foreign elements to appear -->
<xsd:element ref="blockExtra" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:element>
In schema Z:
<!-- this element can appear anywhere blockForeignElement appears -->
<xsd:element name="foo" substitutionGroup="blockns:blockExtra">
...
</xsd:element>
A significant limitation is that you can't have one element appear in multiple substitution groups were you could add the same element to multiple internal entities (See
http://lists.w3.org/Archives/Public/www-xml-schema-comments/2000AprJun/0140.html and a side issue of LC-96 in http://www.w3.org/2000/05/12-xmlschema-lcissues.xml).
If your only desire is to say that any element from a different namespace can appear at that location, you could just use the <xsd:any/> construct.
<xsd:element name="block">
<xsd:sequence>
<!-- add a reference to the abstract element whereever
you will allow foreign elements to appear -->
<xsd:any namespace="##other" minOccurs="0" maxOccurs="unbounded" processContents="lax"/>
</xsd:sequence>
</xsd:element>
The syntax may be a little off, but I think the concepts are right.