xsl-list
[Top] [All Lists]

RE: Dereferencing not working in certain context

2004-01-26 08:48:44
Probably $count is a result tree fragment rather than a number, so it is
interpreted as a boolean predicate rather than a numeric subscript.
Change the way count is declared, or use [number($count)] in the
predicate.

Michael Kay

-----Original Message-----
From: owner-xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com 
[mailto:owner-xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com] On Behalf Of 
Andrew Maclean
Sent: 26 January 2004 15:11
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] Dereferencing not working in certain context


Dear all,

I'm having a problem dereferencing a variable in xsl.  
Getting the value of 
the "count" value (count is a parameter) works in some 
contexts but not in 
others.  A straightforward deref using the dollar sign works 
on it's own, 
but when I put that inside a larger expression it stops working.  I 
illustrate what I mean below:

Values for <xsl:value-of select="$count"/> =
<xsl:value-of 
select="exsl:node-set($A)/derivedType[4]/@typeName"/> = 
<xsl:value-of 
select="exsl:node-set($A)/derivedType[$count]/@typeName"/>

The output of this is:

Values for 4 = TypeD = TypeA

But when count is equal to 4, the variable part of the result 
should be the 
same the as the hard-coded "4" part of the result.  Could 
someone please 
tell me why it doesn't work?

Thanks,

Mr Andrew Maclean

_________________________________________________________________
Express yourself with cool new emoticons 
http://www.msn.co.uk/specials/myemo


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



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



<Prev in Thread] Current Thread [Next in Thread>