[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Referencing unique values by their order number.

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

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.