I have variables that I think can be initialized a couple different ways and I want to know if one way may be more efficient or may help improve transformation time when dealing with large amounts of data.
Here are two examples of how I might declare a variable:
<xsl:variable name="sampleVariable" select="$thisNodeSet[string-length($currentName) > 0 and @NAME=$currentname]
| $thisNodeSet[string-length($currentNameInstance) > 0 and contains(@INSTANCE, $currentNameInstance)]
| $thisNodeSet[string-length($currentName) <= 0 and string-length($currentNameInstance) <= 0]" />
OR
<xsl:variable name="sampleVariable">
<xsl:choose>
<xsl:when test="string-length($currentName)>0">
<xsl:copy-of select="$thisNodeSet[@NAME=$currentname] />
</xsl:when>
<xsl:when test="string-length($currentNameInstance)>0">
<xsl:copy-of select="$thisNodeSet[contains(@INSTANCE, $currentNameInstance)]" />
</xsl:when>
<xsl:otherwise>
<xsl:copy-of select="$thisNodeSet" />
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
I was unsure how each operation would be storing the nodes and wondered if xsl:copy-of
would be storing a lot more in memory somehow.
My question is whether or not one of these methods is faster/more efficient or if they will have similar performance on transformation time, memory, or anything else that could be affected by these methods.
Thanks for the help!
EDIT: It is using the MSXML processor