Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

[text()= or [.= ???

Status
Not open for further replies.

markgravitygood

Programmer
Jan 9, 2008
3
US
Ok, Which is the correct way to handle this xsl:

<xsl:when test="CARRIER_REFERENCE[text()!='610442']">
Do Something
</xsl:when>
OR

<xsl:when test="CARRIER_REFERENCE[.!='610442']">
Do SOmething
</xsl:when>

I have seen it work one way or another, and need to know and understand what thye differences are between [text()= and [.=

TIA!
 
<xsl:when test="node[text()='a']">
<xsl:when test="node = 'a'">
<xsl:when test="node[. ='a']">
all match <context><node>a</node></context>

However, only
<xsl:when test="node[text()='a']">
matches
<context><node>a<othernode>b</othernode></node></context>

In general, it is not advised to have a node contain text as well as childnodes, and in most cases
<xsl:when test="node = 'a'"> will do fine.
 
>In general, it is not advised to have a node contain text as well as childnodes,
As worded like this, I wouldn't take it too seriously without further qualification!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top