What I have is following:
<xsl:variable name="myvar" select=".//spss:category[((not @varName) or @varName=$colVarName) and @text=$series]/spss:cell/@text"/>
What it should do is select the text of the spss:cell
's text-Attribute as long as it is a child of a spss:category
that has
varName
Attribute with a value equal to $colVarName
varName
Attribute at allWhat is happening is following error message (sorry translating here, so just the gist of it):
Expected Token ')'. Found Token '@'.
.//spss:category[((not -->@<-- varName) or @varName=$colVarName...
Problem Solved! (See below)
OK, I think I found the mistake:
not
must be used with parenthesis, so instead of
(not @varName) or @varName=$colVarName
it should have been
not(@varName) or @varName=$colVarName
indeed - not()
is a function that returns the boolean opposite of whatever is between the parens. If necessary - it will cast its argument to a boolean. In this case, an empty node set casts automatically to false, so if @varName
gives you an empty node set, not(@varName)
will be true.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With