Re: [xsl] Referencing unique values by their order number.

Subject: Re: [xsl] Referencing unique values by their order number.
From: Andreas Kemkes <a5sk4s@xxxxxxxxx>
Date: Fri, 8 Dec 2006 15:59:07 -0800 (PST)
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: [xsl] 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

Current Thread