[xslt] problem with duplicate template names



I'm having an issue in all versions of libxslt starting from vs. 1.1.11 and up.  I double-checked this is not happening in 1.1.10, which is what we're upgrading from.  I'm using the defaults on Red Hat ES3, which is 1.1.11, but I've also tried 1.1.14 and 1.1.20 and the problem exists  in those as well. 

We have many areas in our xslt where we reuse template names, in the same process, but they use different namespace prefixes to further identify their source.  I was reading the XSLT spec, and it doesn't seem to be very clear on this issue.  I would be led to assume at a first glance, and my knowledge of namespaces, that a template named:

ns1:foo

is not the same as one named

ns2:foo

assuming ns1 and ns2 map to two separate namespaces. 

Below is a sample xslt that i've been running xsltproc against to verify.  When i run the xsltproc binary i build from ver. 1.1.10, i get no output, a success.  When i run xsltproc from my 1.1.20 version, i get the following error:

[sjohnso ctlabapp1 2005-09]$ xsltproc foo.xsl
compilation error: file foo.xsl line 27 element template
xsl:template: error duplicate name 'foo'

<?xml version="1.0" encoding="UTF-8"?>

<xsl:stylesheet
    version="1.0"
    xmlns=" http://tuc.com/xml/ns/ssi"
    xmlns:ns1="xmlns://tuc.com/xml/ns/ssi/ns1"
    xmlns:ns2="xmlns://tuc.com/xml/ns/ssi/ns2"
    xmlns:xsl=" http://www.w3.org/1999/XSL/Transform">

    <xsl:output
        method="xml"
        indent="yes"
        omit-xml-declaration="yes"/>

    <xsl:template match="/">

        <xsl:call-template name="ns1:blah"/>

    </xsl:template>

    <!-- =================================================================== -->
    <xsl:template name="ns1:foo">

    </xsl:template>

    <!-- =================================================================== -->
    <xsl:template name="ns2:foo">

    </xsl:template>

</xsl:stylesheet>

Thanks in advance for any help you may provide.

Cheers

--
Steve Johnson
steve webninja com

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]