XSLT: If Node = A then set B=1 Else B=2

Posted by Larry on Stack Overflow See other posts from Stack Overflow or by Larry
Published on 2010-03-19T00:36:05Z Indexed on 2010/03/19 0:41 UTC
Read the original article Hit count: 329

Filed under:
|
|

I am looping thru looking at the values of a Node.

If Node = B, then B has one of two possible meanings. 
  --If Node = A has been previously found in the file, then the value for A
    should be sent as 1.
  --If Node = A has NOT been found in the file, the the value for A should 
    be sent as 2.

where file is the xml source to be transformed

I cannot figure out how to do this. If I was using a programming language that allowed for a variable to have its value reassigned/changed, then it is easy. But, with XSLT variables are set once.

© Stack Overflow or respective owner

Related posts about xslt

Related posts about loop