W3C home > Mailing lists > Public > xmlschema-dev@w3.org > July 2008

RE: using multiple namespaces in one element

From: Michael Kay <mike@saxonica.com>
Date: Wed, 9 Jul 2008 22:26:16 +0100
To: <info@minimag.de>, "'XML Schema List'" <xmlschema-dev@w3.org>
Message-ID: <99376D5A85CE4290A8F3BF43E5FFCA23@Sealion>

I think the error message is complaining about an error in your instance
document which is nothing to do with the schema - you have used the prefix
mml in the instance without declaring it in an
xmlns:mml="http://www.w3.org/1998/Math/MathML" declaration.

Having fixed that, to get the instance validated against the MathML schema
you then need to do two things:

(a) use xsl:import in your schema document to import the schema for the
MathML namespace

(b) use processContents="strict" on the xs:any element to ensure that any
MathML elements matching the wildcard are validated against their schema
definitions.

Michael Kay
http://www.saxonica.com/

> -----Original Message-----
> From: xmlschema-dev-request@w3.org 
> [mailto:xmlschema-dev-request@w3.org] On Behalf Of Andreas Peter
> Sent: 09 July 2008 21:48
> To: XML Schema List
> Subject: using multiple namespaces in one element
> 
> 
> Hello list users,
> 
> I have an element which should contain elements from MathML. 
> The problem is when I include an MathML example into the 
> instance document the parser says that the prefix mml is not 
> bounded. MathML should only be possible inside of the 
> mathphrase element.
> 
>     <xs:element name="mathphrase">
>         <xs:complexType>
>             <xs:choice>
>                 <xs:any 
> namespace="http://www.w3.org/1998/Math/MathML" 
> minOccurs="0" maxOccurs="unbounded"/>
>             </xs:choice>
>         </xs:complexType>
>     </xs:element>
> 
> How can I include the whole MathML namespace into my schema?
> 
> I am thankful for every hint,
> 
> Andreas
> 
Received on Wednesday, 9 July 2008 21:26:54 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:15:05 GMT