0

A variable is being used to store related record information

The variable has been updated to dynamically select, depending on results of a match,

eg

<xsl:variable name="SO">
            <xsl:choose>
                <xsl:when/>
                <xsl:otherwise/>

            </xsl:choose>
        </xsl:variable>

this is working, as counting the variable returns (using the node-set function to inspect the result tree fragment)

When trying to access fields in the node-set in the variable, am no longer able to

eg the UniqueId field exists on the original document that the variable is created from but no value is returned when using

<xsl:value-of select="string(msxsl:node-set($SO)/UniqueId)"/>

Does that make sense?!
Is this possible, to have choose when in a variable of a node-set?!
What am I doing wrong?!

thanks in advance!!

1 Answers1

-1

issue stemmed from choosing value-of

resolved by using copy-of, then referencing variable as value-of select="msxsl:node-set($var)"

kudos to tryst

  • 1
    This doesn't help anyone. – michael.hor257k Apr 21 '23 at 16:04
  • If you are getting the value of the variable using `xsl:value-of`, then there is no good reason to populate it using `xsl:copy-of`. It only adds unnecessary complication. A value populated with a single text node does not need to be converted to a node-set. – y.arazim Apr 25 '23 at 10:45