Re: Referencing unique values by their order number.
David: Thanks for the quick answer. I do not have a separate file - and I'd rather avoid it. The items are part of the same output XML. Currently all I have is a variable <xsl:variable name="items" select="item[not(preceding-sibling::item = .)]"/> containing the unique item set. I guess I need some sort of reverse index that maps the value from the preceding-sibling::item (the one before the <text> elements) back to the index into the 'items' array. I just don't seem to be able to figure it out in XSLT. Andreas ----- Original Message ---- From: David Carlisle <davidc@xxxxxxxxx> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx Cc: a5sk4s@xxxxxxxxx Sent: Friday, December 8, 2006 3:22:25 PM Subject: Re: Referencing unique values by their order number. If youve already made <items> <item>V1</item> <!-- item 0 --> <item>V2</item> <!-- item 1 --> <item>V3</item> <!-- item 2 --> </items> and put it in file1.xml then <item><xsl:value-of select="'missing-expression'"/></item> is <item><xsl:value-of select="count(doc('file1.xml')/items/item[.=current()]/preceding-sibling::*)" /></item> as always, keys can be used to speed up this kind of expression. David _____________________________________________________________________________ _______ Cheap talk? Check out Yahoo! Messenger's low PC-to-Phone call rates. http://voice.yahoo.com
PURCHASE STYLUS STUDIO ONLINE TODAY!
Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!
Download The World's Best XML IDE!
Accelerate XML development with our award-winning XML IDE - Download a free trial today!
Subscribe in XML format