[xsl] how to test if a child node have a specific name?

Subject: [xsl] how to test if a child node have a specific name?
From: "Chen Yi" <chen_yi36@xxxxxxxxxxx>
Date: Fri, 28 May 2004 20:52:45 +0800
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


_________________________________________________________________
SkA*;z5DEsSQ=xPP=;Aw#,GkJ9SC MSN Messenger: http://messenger.msn.com/cn


Current Thread