I am using Saxon 9 EE with Oxygen XML 12.1
I an trying to set a variable to a temporary result and I have a way that works, and a way that does not. When I dump the results, they look the same to me. I cannot figure out why one works and the other doesn't.
This way works:
Code:
<xsl:variable name="iterdef"
select="nmirepo:findIteratorDef($myData/IteratorTagRef[1]/@Idref)"/>
This way does not:
Code:
<xsl:variable name="iterdefx">
<xsl:sequence select="nmirepo:findIteratorDef($myData/IteratorTagRef[1]/@Idref)"></xsl:sequence>
</xsl:variable>
When I dump using:
Code:
<xsl:message>
[iterdef]
<xsl:sequence select="$iterdef"></xsl:sequence>
[iterdefx]
<xsl:sequence select="$iterdefx"></xsl:sequence>
[-----]
</xsl:message>
I get:
Code:
[iterdef]
<IteratorDef xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><IteratorTag Id="BABEGAJE">allOCn</Iterat
orTag><IteratorList><IteratorChoice>3</IteratorChoice><IteratorChoice>12</IteratorChoice><IteratorChoice>48</IteratorChoice><Iterato
rChoice>192</IteratorChoice></IteratorList></IteratorDef>
[iterdefx]
<IteratorDef xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><IteratorTag Id="BABEGAJE">allOCn</Iterat
orTag><IteratorList><IteratorChoice>3</IteratorChoice><IteratorChoice>12</IteratorChoice><IteratorChoice>48</IteratorChoice><Iterato
rChoice>192</IteratorChoice></IteratorList></IteratorDef>
[-----]
Which looks identical to me (do you see any differences?)
I have not included the findIteratorDef() code, it basically dereferences the Idref tag and returns what it finds as the temporary result that you see in the output.
If I pass on the $iterdef content to the rest of my code it works the way I expected it to. If I pass $iterdefx content, it does not. It basically acts as though I passed nothing at all.
My question is, are the two ways I'm setting the variables equivalent?
(I'm guessing not since I do not get equivalent results)
So, besides what I see visually by using xsl:message to dump to my display, what else can be different with the two version of the variables that is unseen?