XSL doesn't copy namespaced attributes

webmasterbeta

New Member
Hello everyone,
i got a problem with XSL, xsl:copy seems to ignore namespaced attributes.

My XML-File looks like:


<?xml version="1.0" encoding="utf-8"?>
<Order xmlns="some_uri" xmlns:xsi="some_uri" xsi:schemaLocation="some_uri">
<Contractingpartner>
...



Well since i needed a conversation of this file into another i wrote a XSL-transformation that looks like:


<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:eek:utput method="xml" indent="yes" encoding="UTF-8"/>

<xsl:template match="/">
<xsl:copy>
<xsl:apply-templates/>
</xsl:copy>
</xsl:template>
...


It works fine but the namespaced attribute xsi:schemaLocation is omitted and does not occur in the result file !

The attribute can be copied by inserting this for-each-Block into xsl:copy but the namespace is omitted although :( This suxxxxxx !!


<xsl:for-each select="./@*">
<xsl:variable name="current_attribute_name">
<xsl:value-of select="local-name()"></xsl:value-of>
</xsl:variable>
<xsl:attribute name="{$current_attribute_name}">
<xsl:value-of select="current()"></xsl:value-of>
</xsl:attribute>
</xsl:for-each>


Has anyone an idea for solving this problem ??

Thx
 
Top