This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]