[xsl] JDK 5 XSLTC handling of namespace prefixes

Subject: [xsl] JDK 5 XSLTC handling of namespace prefixes
From: Julian Reschke <julian.reschke@xxxxxx>
Date: Mon, 19 Dec 2005 12:19:27 +0100
Hi,

I'm currently experiencing a somewhat weird behavior of JDK's XSLTC, when using xsl:element.

Example:

input.xml:

<D:multistatus xmlns:D="DAV:"/>

test-ns.xslt:

<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
                version="1.0"
>

<xsl:template match="*">
  <xsl:element namespace="{namespace-uri()}" name="{local-name()}" />
</xsl:template>

<xsl:template match="/">
        <xsl:copy><xsl:apply-templates select="node()" /></xsl:copy>
</xsl:template>

</xsl:transform>


Expected result:


<multistatus xmlns="DAV:"/>


What I get is:


<ns0:multistatus xmlns:ns0="DAV:"/>


So XSLTC is rewriting prefixes, and it seems that <http://www.w3.org/TR/xslt#section-Creating-Elements-with-xsl:element> allows it to do so, and generally, the difference shouldn't be significant.


But in this case, it is, because I'm using XSLT to normalize results of a test suite, and the whole point here was to abstract away prefixes.

So is there a way to configure this?


Help appreciated,


Julian

Current Thread