xsl-list
[Top] [All Lists]

how to test if a child node have a specific name?

2004-05-28 05:52:45
ALl,
I want to test if the first child node is a specific name "NodeName" node.I use the following expression.

<xsl:if test="child::node()[1]=NodeName">
  ...
</xsl:if>

But it doesn't work.
Then I changed the expression to
<xsl:if test="child::node()[1]='NodeName'">
  ...
</xsl:if>

or
<xsl:if test="name(child::node()[1])='NodeName'">
  ...
</xsl:if>

They all seem work.

I want to know which one is the correct one?
Thanks.


Chen Yi

_________________________________________________________________
与联机的朋友进行交流,请使用 MSN Messenger: http://messenger.msn.com/cn