Subject: Re: [xsl] newbie: problems computing output from variables From: David Carlisle <davidc@xxxxxxxxx> Date: Wed, 7 Feb 2001 12:50:47 GMT |
> 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() < 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() < 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 |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] newbie: problems computin, Michael Kay | Thread | Re: [xsl] newbie: problems computin, Francis Norton |
RE: [xsl] newbie: problems computin, Michael Kay | Date | RE: [xsl] Multiply, Linda van den Brink |
Month |