xsl-list
[Top] [All Lists]

Re: [xsl] Counting the number of elements in a variable before looping

2007-06-27 09:28:14
sudheshna iyer wrote:
I need to find out how many elements are present in
the variable "computers" in the below for-each.

<xsl:for-each select="$computers">

I need to display a message to the user based on the
number of elements that are present.

Is there any variable called count for doing the above?

There is a method called count <http://www.w3.org/TR/xpath#function-count> that you can use:
  count($computers)


--

        Martin Honnen
        http://JavaScript.FAQTs.com/

--~------------------------------------------------------------------
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>