Altova Mailing List Archives


[xsl] Namespace missing after transform

From: "Hofman, Peter" <peter.hofman@------------->
To:
Date: 9/8/2006 12:18:00 PM
Hi,

I have difficulties getting all necessary namespaces in the output while
performing XML to XML transformation.

The source document contains typed elements like this:

<elem xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xmlns:xs="http://www.w3.org/2001/XMLSchema"
          xsi:type="xs:short">30</elem>

When I copy it using the following xsl template the xmlns:xs reference
is missing.

Template:

<xsl:template match="elem">
	<xsl:element name="elem">
		<xsl:attribute name="xsi:type"
			xmlns:xs="http://www.w3.org/2001/XMLSchema"

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
			<xsl:value-of select="@xsi:type"/>
		</xsl:attribute>
		<xsl:value-of select="."/>
	</xsl:element>
</xsl:template>

Result:

<elem xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:type="xs:short">30</elem>

Any ideas how to fix this?

Additional information:
XSL version: 1.0
XSLT processor: not sure, I think it is SAX based. Anyway, problem also
occurs with msxsl.exe (version 4.0).

Kind regards,

Peter Hofman


This e-mail and any attachment is for authorised use by the intended
recipient(s) only. It may contain proprietary material, confidential
information and/or be subject to legal privilege. It should not be copied,
disclosed to, retained or used by, any other party. If you are not an intended
recipient then please promptly delete this e-mail and any attachment and all
copies and inform the sender. Thank you.

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.