[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

[xsl] Creating a variable based on another element value

Subject: [xsl] Creating a variable based on another element value
From: "james walker" <jameswalkerandy@xxxxxxxxxxx>
Date: Wed, 08 Oct 2003 14:38:03 +0100

Given this xm ldoc:
<ve pos=1"><entrydata><text>mena</text></entrydata></ve>
<ve pos=2"><entrydata><text>proc</text></entrydata></ve>
<ve pos=3"><entrydata><text>security</text></entrydata></ve>
<ve pos=4"><entrydata><text>protocal</text></entrydata></ve>
<ve pos=5"><entrydata><text>network</text></entrydata></ve>
<ve pos=6"><entrydata><text>lol</text></entrydata></ve>

I would like to store the position number of the <ve> tag (in a variable called "secpos") which contains entrydata[0]/text='Security. I have got the ve which does this but i dont know how to extract the position attribute and create a variable at the same time? This is what i have got at the moment:

<xsl:variable name="secpos" select="viewentry[entrydata/text='Security']" />

but i need it to store the position attribute of the ve which has text containing security? Apologies if this question is a bit easy to others but i didnt know where to look..

Sign-up for a FREE BT Broadband connection today! http://www.msn.co.uk/specials/btbroadband

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

Current Thread