xsl-list
[Top] [All Lists]

RE: [xsl] Trying to figure out the child::item[position()=1] syntax

2006-07-10 14:39:12
Your path expression:
menuItems[child::menuItem[position()=1]/pageID = $pageID]
can be simplified to
menuItems[menuItem[1]/pageID = $pageID]

to be a bit more idiomatic.

Is being more idiomatic a good or bad thing? ;o)

When you use the path expression in an xsl:if instruction, 
the node-set is converted to a boolean: true if there is at 
least one node, otherwise false.

When you use the path expression in an xsl:value-of 
instruction, the node-set is converted to a string

Hope that makes it clearer.

It makes perfect sense. Thanks, Michael!

-Darrel

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

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