[xslt] BUG?



I think this is a bug in xsltproc

Stylesheet:
========

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                              
xmlns:libxslt="http://xmlsoft.org/XSLT/namespace">
 
<xsl:output method="xml" indent="yes" encoding="ISO-8859-1"/>
<xsl:variable name="one">
<xsl:copy-of select="."/>
</xsl:variable>
<xsl:variable name="two" select="document('two.xml')"/>
 
<xsl:template match="/">
        <xsl:apply-templates select="$two" mode="two"/>
</xsl:template>
 
<xsl:template match="*" mode="two">
        <xsl:for-each select="//content">
                <xsl:apply-templates select="libxslt:node-set($one)" 
mode="one"/>
                <xsl:text>-----------------</xsl:text>
        </xsl:for-each>
</xsl:template>
 
<xsl:template match="*" mode="one">
        <xsl:for-each select="//content">   
<!-- here is the problem (.//content works well, but I need the key 
function)-->
                <xsl:copy-of select="."/>
        </xsl:for-each>
</xsl:template>
 
</xsl:stylesheet>

one.xml
======
<?xml version="1.0"?>
<eins>
<content>content of one</content>
</eins>

two.xml
======
<?xml version="1.0"?>
<two>
<content>content of two1</content>
<content>content of two2</content>
<content>content of two3</content>
</two>

RESULT:
========
> xsltproc test.xslt one.xml
<?xml version="1.0" encoding="ISO-8859-1"?>
<content>content of two1</content>
<content>content of two2</content>
<content>content of two3</content>
-----------------
<content>content of two1</content>
<content>content of two2</content>
<content>content of two3</content>
-----------------
<content>content of two1</content>
<content>content of two2</content>
<content>content of two3</content>
-----------------

Expected Result:
=============
<?xml version="1.0" encoding="ISO-8859-1"?>
<content>content of one</content>
-----------------
<content>content of one</content>
-----------------
<content>content of one</content>
-----------------

Version
=======
 xsltproc -V
Using libxml 20400 and libxslt 10000
xsltproc was compiled against libxml 20400 and libxslt 10000
libxslt 10000 was compiled against libxml 20400

OS:
===
 uname -a
Linux linuxdaheim 2.2.19 #9 SMP Mon Jun 4 21:02:03 CEST 2001 i686 unknown

Bernhard





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