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

Subject: RE: [xsl] Trying to figure out the child::item[position()=1] syntax
From: "Austin, Darrel" <Darrel.Austin@xxxxxxxxxxxxxxxxxx>
Date: Mon, 10 Jul 2006 16:38:53 -0500
> 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

Current Thread