[xslt] libxslt 1.0.14 fails attribset40 test from Oasis XSLT conformancesuite



This is reproducible with libxxslt 1.1.4/libxml2 2.6.4. Sorry I didn't 
test this with 1.1.5/2.6.5 but it didn't appear to be in the ftp 
archives yet. This is a very tricky test case. Start with this XML file:

<?xml version="1.0"?>
<docs>
  <b>bdd:attr</b>
</docs>

Then use this XSLT stylesheet:

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 
version="1.0"
            xmlns:bdd="http://bdd.test.com";>

  <!-- FileName: attribset40 -->
  <!-- Document: http://www.w3.org/TR/xslt -->
  <!-- DocVersion: 19991116 -->
  <!-- Section: 7.1.3 Creating Attributes -->
  <!-- Creator: David Marston -->
  <!-- Purpose: The attribute must be in the designated namespace, even 
if the prefix has
    to be reset or ignored. -->

<xsl:template match="/">
  <out>
    <bdd:jam>
      <xsl:attribute name="{docs/b}" 
namespace="http://xyz.com";>jaminben</xsl:attribute>
    </bdd:jam>
  </out>
</xsl:template>

</xsl:stylesheet>


The output should be something like:

<?xml version="1.0"?>
<out xmlns:bdd="http://bdd.test.com";><bdd:jam xmlns:pre="http://xyz.com"; 
pre:attr="jaminben"/></out>

That is libxslt should *remap the attribute prefix to avoid the 
namespace conflict*. Yes, I know that's weird but it is what the spec 
and the test case say. Instead what we get is this, which is clearly 
wrong because it changes the jam element's namespace:

<?xml version="1.0"?>
<out xmlns:bdd="http://bdd.test.com";><bdd:jam xmlns:bdd="http://xyz.com"; 
bdd:attr="jaminben"/></out>


--
Elliotte Rusty Harold




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