RE: newbie: problems computing output from variables
> My xsl (fumblings) are: > > <xsl:template match="/"> > ... > <xsl:variable name="edits" select="id != edit_id"/> > <xsl:variable name="editvase" select="$edits[position() < 6]"/> > <xsl:for-each select="/faqs/faq"> > <xsl:choose> > <xsl:when test="$edits"> > <xsl:value-of select="$question"/><br/> > Your're setting $edits to a value: true if the root node has an <id> child and an <edit_id> child with the same string value. It doesn't, so $edits is always false. Then you're trying to select those nodes in $edits whose position is less than 6. But $edits is false, it doesn't contain any nodes, so the selection is meaningless. I think you wanted $edits to be an expression which is evaluated later: that's not the way it works. You don't need variables at all here, just: <xsl:for-each select="faqs/faq[id!=edit_id][position() < 6]"> <xsl:value-of select="question"/><br/> Mike Kay XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
PURCHASE STYLUS STUDIO ONLINE TODAY!
Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!
Download The World's Best XML IDE!
Accelerate XML development with our award-winning XML IDE - Download a free trial today!
Subscribe in XML format