|
-
Jan 15th, 2004, 11:51 AM
#1
Thread Starter
Lively Member
xslt --> position() function
I'm learning xslt at the moment, I want to use the following as a means to compare a value to the same value on a previous node in a node set.
<xsl:if test="column[@name='Database Name']/@value!=(//records/record)[string(position()-1)]/column[@name='Database Name']/@value">
where the data looks a bit like this
<records>
<record>
<column name="Database Name" value="DB1"/>
</record>
<record>
<column name="Database Name" value="DB2"/>
</record>
</records>
Unfortunately the bit where I refer to position() - 1 doesn't work. using a value-of on it's own will output it as text and sometimes it will display something (usually the first node) but it can't do the comparison.
HELP!!!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|