Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: Include Elements from other namespace in own XML

From: Martin Honnen <mahotrash@-----.-->
To: 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/


transparent
Print
Mail
Like It
Disclaimer
.

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 www.altova.com/list/index.html. 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.

.
.

transparent

transparent