Hi,

I'm getting this problem:

<xsl:apply-templates select="xalan:nodeset($param1)//b|b"/>

and

<xsl:apply-templates select="xalan:nodeset($param1)//b"/>
<xsl:apply-templates select="b"/>

are giving me different result. From my knowledge, this should not happen. What am I doing wrong here?

xsl, input xml and output xml are attached.

thanks,
Guoliang Cao
<?xml version="1.0"?>
<xsl:stylesheet
    xmlns:xalan="http://xml.apache.org/xalan";
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
    exclude-result-prefixes="xsl xalan"
    version="1.0">

<xsl:output method="xml" indent="yes"/>
<xsl:strip-space elements="*"/>

<xsl:variable name="existData">
    <a>
        <b>
            <id>120</id>
        </b>
    </a>
</xsl:variable>

<xsl:template match="/">
    <xsl:apply-templates select="a">
        <xsl:with-param name="param1" select="$existData"/>
    </xsl:apply-templates>
</xsl:template>

<xsl:template match="a">
    <xsl:param name="param1"/>
    <a>
        <xsl:apply-templates select="xalan:nodeset($param1)//b|b"/>
        <xsl:apply-templates select="b"/>
    </a>
</xsl:template>

<xsl:template match="b">
    <xsl:copy-of select="."/>
</xsl:template>

</xsl:stylesheet>
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="C:\upx3\Neon-IPSec-WF\workflow\temp.xsl"?>
<a>
	<b>
		<id>100</id>
	</b>
	<b>
		<id>110</id>
	</b>
</a>
<?xml version="1.0" encoding="UTF-8"?>
<a>
	<b>
		<id>120</id>
	</b>
	100
	<b>
		<id>100</id>
	</b>
	<b>
		<id>110</id>
	</b>
</a>

Reply via email to