Altova Mailing List Archives>Archive Index >comp.text.xml Archive Home >Recent entries >Thread Prev - Include Elements from other namespace in own XML >Thread Next - Re: Include Elements from other namespace in own XML Re: Include Elements from other namespace in own XMLTo: NULL Date: 7/1/2007 3:48:00 PM
Benjamin Kalytta wrote:
> I'm wondering if it is possible to include elements from other
> namespaces in own xml files.
Yes, that is certainly possible.
> My Schema file looks like:
>
> [...]
> <xs:element name="string">
> <xs:complexType mixed="true">
> <xs:sequence minOccurs="0">
> <xs:any namespace="http://www.w3.org/1999/xhtml"
> processContents="strict" />
If you use processContents="strict" then you need to provide/use a
schema for the XHTML namespace http://www.w3.org/1999/xhtml. If you use
processContents="lax" then the parser can validate if a schema is available.
> </xs:sequence>
> <xs:attribute name="name" type="xs:string" use="required" />
> </xs:complexType>
> </xs:element>
>
> Corresponding xml could be:
>
> [...]
> <string id="xyz">This is a <html:strong>test</html:strong></string>
You use an attribute named 'id' but your schema defines one named 'name'.
> You see, what I want is first to allow such xml tags within xml file and
> second transform it into corresponding <strong>.
>
> If I use some XML DOM API like:
>
> element = document.getElementbyId("xyz");
For document.getElementById to work for XML documents the attribute used
needs to be defined as type xs:ID.
--
Martin Honnen
http://JavaScript.FAQTs.com/
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
