Count number of child nodes of a sibling in XSLT
I need to be able to count how many child nodes the sibling element has.  I need to change the CSS class to be "no_border" on an anchor tag based upon whether the next anchor tag has any child nodes.

What I have so far is like this :
    
    <xsl:for-each select="Menu/Item">
      <li>
        <a>
          <xsl:attribute name="class">
            <xsl:if test="following-sibling::Item/count(Menu/Item)">
              no_border
            </xsl:if>
          </xsl:attribute>
          <xsl:value-of select="ItemTitle />
        </a>
       </li>
    </xsl:for-each>

Visual Studio is telling me : 

>Error	1	Expected end of the expression, found '('.  following-sibling::Item/count -->(<-- Menu/Item)	C:\Projects\***\XmlFiles\xslt\SiteMap.xslt	78	74	C:\Projects\***\

So it looks like I can't put the "count()" command after "following-sibling".

Here is a sample of the XML:

    <root>
      <Item>
        <Menu>
          <Item>
          ... other sub-nodes
          </Item>
        </Menu>
      </Item>
      <Item>
        <Menu>
          <Item>
          ... other sub-nodes
          </Item>
        </Menu>
      </Item>
    </root>
    

Edit: I found the solution:

    <xsl:if test="count(following-sibling::Item/Menu/Item) = 0" >

Count number of child nodes of a sibling in XSLT
===

I need to be able to count how many child nodes the sibling element has.  I need to change the CSS class to be "no_border" on an anchor tag based upon whether the next anchor tag has any child nodes.

What I have so far is like this :
    
    <xsl:for-each select="Menu/Item">
      <li>
        <a>
          <xsl:attribute name="class">
            <xsl:if test="following-sibling::Item/count(Menu/Item)">
              no_border
            </xsl:if>
          </xsl:attribute>
          <xsl:value-of select="ItemTitle />
        </a>
       </li>
    </xsl:for-each>

Visual Studio is telling me : 

>Error	1	Expected end of the expression, found '('.  following-sibling::Item/count -->(<-- Menu/Item)	C:\Projects\***\XmlFiles\xslt\SiteMap.xslt	78	74	C:\Projects\***\

So it looks like I can't put the "count()" command after "following-sibling".

Here is a sample of the XML:

    <root>
      <Item>
        <Menu>
          <Item>
          ... other sub-nodes
          </Item>
        </Menu>
      </Item>
      <Item>
        <Menu>
          <Item>
          ... other sub-nodes
          </Item>
        </Menu>
      </Item>
    </root>
    

Edit: I found the solution:

    <xsl:if test="count(following-sibling::Item/Menu/Item) = 0" >
