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

Re: newbie: problems computing output from variables

Subject: Re: newbie: problems computing output from variables
From: David Carlisle <davidc@xxxxxxxxx>
Date: Wed, 7 Feb 2001 12:50:47 GMT
Re:  newbie: problems computing output from variables

> Xerces  tells me that it is unable to convert #BOOLEAN to a NodeList.

which is a rather exact description of the problem (compared with
typical compiler error messages)


$edits[position() &lt; 6]. 

you can only apply a filter [....] to a node list, and that produces
a current node list for which the predicate is true.

Your $edits variable (despite its name) does not contain nodes
it is a boolean (either true or false)

You have

<xsl:variable name="edits" select="id != edit_id"/>

so that select expression doesn't select any nodes, it just returns true
or false depending on whether id = edit_id. As you evaluate this in the
root template, and the child of the root is called faqs, both id and
edit_id will select an empty node set. 
for node sets a != b is true if _any_ node in a has a string value that
is not equal to any node in b. In your case, both node sets are empty
so there are no nodes not equal, so the predicate is false.

> The point of this is to display only the *x most recently edited
> questions*


<xsl:template match="/">
<xsl:apply-templates
  select="/faqs/faq[id != edit_id][last() - position() &lt; 6]"/>
</xsl:template>

<xsl:template match="faq">
....
</xsl:template>

David

_____________________________________________________________________
This message has been checked for all known viruses by Star Internet delivered
through the MessageLabs Virus Control Centre. For further information visit
http://www.star.net.uk/stats.asp

 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.