返回节点中子节点的数目。
这是我的XML:
<LIGHT_INFORMATION_LIST>
<LIGHT_INFORMATION>
<LIGHT_COLOUR>W-G</LIGHT_COLOUR>
</LIGHT_INFORMATION>
<LIGHT_INFORMATION>
<LIGHT_COLOUR>W-R</LIGHT_COLOUR>
</LIGHT_INFORMATION>
<LIGHT_INFORMATION>
<LIGHT_COLOUR>R</LIGHT_COLOUR>
</LIGHT_INFORMATION>
<LIGHT_INFORMATION>
<LIGHT_COLOUR>G</LIGHT_COLOUR>
</LIGHT_INFORMATION>
<LIGHT_INFORMATION>
<LIGHT_COLOUR>W</LIGHT_COLOUR>
</LIGHT_INFORMATION>
</LIGHT_INFORMATION_LIST>
请求输出:
输出请求为5。(称为LIGHT_INFORMATION的子级的编号)
这就是解决方案:
<xsl:value-of select="count(LIGHT_INFORMATION_LIST/LIGHT_INFORMATION)"/>
返回5