[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: xsl:for-each result
> Shouldn't the title-suffix variable > be bound to an empty sequence, whose effective boolean value is false? No (the wording of that is the only indication that you might be using xslt2) I'll give the XSLT1 answer first (which is a faq) using a variable with no select attribute and non empty content it always generates a result tree fragment which contains at least a root node below that any nodes that are generated by the content. So it always corresponds to a node set with exactly one value (/) so count(xx:node-set($x)) is always one and it always counts as true() as it is equivalent to a non empty node set. In xslt 2 the above is true still if you replace "result tree fragment" by sequence, "root node" by "document node" and delete reference to the node-set extension. However in xslt2 you have the option of adding as="element()*" (for example) to the variable binding in which case the generated sequence of elements will be returned directly as the result of the variable not all made children of an implied document node. then it will coerce to false if empty. David ________________________________________________________________________ This e-mail has been scanned for all viruses by Star. The service is powered by MessageLabs. For more information on a proactive anti-virus service working around the clock, around the globe, visit: http://www.star.net.uk ________________________________________________________________________
|
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
|