Altova Mailing List Archives
>xsl-list Archive Home
>Thread Prev -
>Thread Next - Re: [xsl] Namespace missing after transform
[xsl] Namespace missing after transform
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.