This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

current()


Hi,

I have a problem with unique nodes by using preceding-sibling-axis and the
current()-function.

My XML:

<cluster>
    <inst machine="test1.virbus.de" inst-src="srctest"/>
    <inst machine="test2.virbus.de" inst-src="srctest2"/>
    <inst machine="test3.virbus.de" inst-src="srctest"/>
</cluster>

My XSL:

<xsl:template match="cluster">
    <xsl:apply-templates
select="inst[not(preceding-sibling::inst[@inst-src=current()/@inst-src])]"/>
</xsl:template>

<xsl:template match="inst">
    <target>
        <name><xsl:value-of select="@inst-src"/></name>
        <xsl:for-each
select=".|following-sibling::inst[@inst-src=current()/@inst-src]">
            <depends><xsl:value-of
select="concat(@machine,'::',@inst-src)"/></depends>
        </xsl:for-each>
    </target>
</xsl:template>

What's wrong with
'inst[not(preceding-sibling::inst[@inst-src=current()/@inst-src])]'? The
only thing I can imagine is the current()-function. Shouldn't it relate to
the inst, I'm testing on for applying?

The above stylesheet is working with Xalan 2.2.D9, but not with the later
versions. I want to know which is the correct behaviour. With MSXML 4 it
doesn't work too.

Regards,

Joerg


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]