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

Re: Generating a list of items NOT present in source X

Subject: Re: Generating a list of items NOT present in source XML
From: Jeni Tennison <jeni@xxxxxxxxxxxxxxxx>
Date: Fri, 17 May 2002 23:55:06 +0100
Re:  Generating a list of items NOT present in source X
Hi Greg,

>>   <xsl:with-param name="count" select="count + 1" />
>
>      [  Just for those following this thread (and later
>       in the archives), the above line (and others like
>       it) should probably read as
>       <xsl:with-param name="count" select="$count + 1" />
>       Note the dollar-sign before 'count'.  Without it,
>       you will have an infinite recursion. ]

Good catch! Whoops.

> The above works for the simple XML document given in the previous
> post because the string() of the obj node is the same as the
> string() of the only contained obj/childnode node. What is the best
> way (or is there a way) to allow $index to be converted from a
> string to the XPath that the string represents?

You can't do dynamic evaluation of XPaths within XSLT. If you just
want to go down one level, the best way is to have $index hold a
string just containing the name of the child node that you want to
select. Then you can do:

 <xsl:when test="$start-number > $nodes[1]/*[local-name() = $index]">
   ...
 </xsl:when>

and so on. (I'm not really sure why you want to do it like this -- why
not pass in the childnodes directly?)

Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/


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


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.