Finding nodes which hold for multiple conditions

Ginu

Usenet Archive
Joined
Dec 14, 2004
Messages
6
Reaction score
0
Hi,
the task is to identify semantically identical elements where some additional attributes do not match.

The XSL-transformation should find a node NAME which @id attribute matches to another NAME/@id in the document tree and additionally a specific further conditions holds (@cid's shouldn't be the same). For that I would like to refer to the node selected in the "following" axes, but I do not know how to refer to this "current-following" node. <xsl:if test="./NAME/@cid=following::NAME/@cid">

and now I would liek to refer to the current and the selected following node for further checks like <!--[CURRENT@id != CURRENTFOLLOWING-@id]" --> ....
</xsl:if>
 

Martin Honnen

Usenet Archive
Joined
Apr 8, 2000
Messages
6,174
Reaction score
0
Ginu wrote:

The XSL-transformation should find a node NAME which @id attribute matches to another NAME/@id in the document tree and additionally a specific further conditions holds (@cid's shouldn't be the same). For that I would like to refer to the node selected in the "following" axes, but I do not know how to refer to this "current-following" node. <xsl:if test="./NAME/@cid=following::NAME/@cid">

and now I would liek to refer to the current and the selected following node for further checks like <!--[CURRENT@id != CURRENTFOLLOWING-@id]" -->

I am not sure I understand what you want but there is the current function in XSLT http://www.w3.org/TR/xslt#misc-func to find the current node so maybe that is what you are looking for. It can also help to use a variable e.g. <xsl:variable name="variableName" select="xpath expression here"> to temporarily store a node or nodeset.
 

Richard Tobin

Usenet Archive
Joined
Jan 6, 2000
Messages
4,251
Reaction score
0
Ginu said:
<xsl:if test="./NAME/@cid=following::NAME/@cid">

and now I would liek to refer to the current and the selected following node for further checks like <!--[CURRENT@id != CURRENTFOLLOWING-@id]" -->

If I understand you correctly, you can put a predicate on the following::NAME node that compares its id attribute with current's.

<xsl:if test="./NAME/@cid=following::NAME[@id != current/@id]/@cid">

-- Richard
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
548,208
Messages
3,104,799
Members
249,594
Latest member
henrywalsh

Latest Threads

Top