[xslt] libxslt bug? stripping namespace prefix in element output.



Howdee.

I have been beating my head against a problem and am wondering if it is 
a bug. I am having problems outputing elements in an html file that have 
a different namespace prefix. Something like <MSHelp:Keyword Index="K" 
Term="foo"/>

Here is a simple example. Given an XML file of:

<?xml version="1.0"?>
<sample>
  <foo name="one"/>
  <foo name="two"/>
  <foo name="three"/>
  <foo name="four"/>
</sample>

And a stylesheet of:

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.1"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
  xmlns:foo="http://borland.com/bogus";>
  <xsl:output method="html" indent="yes"/>

  <xsl:template match="/">
    <html>
    <xsl:for-each select="/sample/foo">
        <xsl:element name="foo:whatever">
          <xsl:value-of select="@name"/>
        </xsl:element>
    </xsl:for-each>
    </html>
  </xsl:template>
</xsl:stylesheet>

I get an output of:

<html>
<whatever>one</whatever><whatever>two</whatever><whatever>three</whatever><whatever>four</whatever>
</html>

So, it seems to be stripping the foo: prefix off the foo:whatever 
element. Does this using both xsltproc and Python. Seems to work fine on 
Microsoft's processor and on Saxon.






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