Onyxdragun
Onyxdragun

Reputation: 109

Can't find what XPath function this belongs to

I'm currently trying to understand a XSL document I am working on and have come across this

<xsl:when test="(string(@hideIfHardwareIs)='')>

I found that in XSLT 2.0 there is fn:string(). Is the above string() the same? Meaning it will return a string version of what it finds at hideIfHwardwareIs ?

Upvotes: 1

Views: 32

Answers (1)

JLRishe
JLRishe

Reputation: 101748

Yes, you are correct. string() produces the string value of its argument. In this case, it and the other set of parentheses are redundant, because the comparison with '' should automatically convert it to a string. This should be fine:

<xsl:when test="@hideIfHardwareIs = ''">

string() function in the XPath 1.0 spec

Upvotes: 1

Related Questions