6

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

  • either a varName Attribute with a value equal to $colVarName
  • OR no varName Attribute at all

What 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)

2
  • Then delete your question in order not to mislead people to spend time on it Jan 22, 2009 at 14:27
  • 1
    Dimitre, I can only accept my own answer 48 hours from now. I allready tried that. Also, I would like to keep this in the system, since it was not obviously found by google (the only post I found to the question I asked had the wrong syntax!) Jan 22, 2009 at 14:58

2 Answers 2

10

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
0
2

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.