[xsl] Re: namespace issues

Subject: [xsl] Re: namespace issues
From: "Shawn O. McKenzie" <smckenzie@xxxxxxxxxxx>
Date: Mon, 31 Mar 2003 16:39:12 -0800


However for me (Linux and libxslt via xsltproc) there is only
<Keyword>


it comes out unprefixed?
The only reason I could see for your code not producing the attributes
if you have set xml:space somewhere so that you are generating a (white)
text node child of the mshelp:Keyword element. You can not add attribute
nodes once you have added a child.

Yes. I am beginning to think this is a bug with libxslt. For instance, given a sample XML file of:


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

And a transform 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>

Using libxslt (either via xsltproc or Python) I get:

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

Guess I'll post that as a bug and try a different processor.


XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list



Current Thread