I am using the node-set
built-in-function to convert an xsl variable into a nodeset as in the code below
<xsl:variable name="allotmentValuesNodeSet" select="msxsl:node-set($allotmentValues)"/>
The command <xsl:copy-of select="$allotmentValuesNodeSet"/>
produces the following output:
<values>
<month>Mar</month>
<incomeQTD>1499.63109246680</incomeQTD>
<realizedQTD />
<incomeYTD>1519.35773710483</incomeYTD>
<realizedYTD />
<incomePrevYTD>1519.35773710483</incomePrevYTD>
<realizedPrevYTD />
<month />
<incomeQTD />
<realizedQTD />
<incomeYTD />
<realizedYTD />
<incomePrevYTD />
<realizedPrevYTD />
</values>
When I try to query the node-set variable with this xsl command <xsl:value-of select="count($allotmentValuesNodeSet/values/month)"/>
I always get 0
, although the result should be 2
.
The allotmentValues
variable is included between other, outer xml nodes. If I do not include it between any xml nodes, then the code works as expected.
Is there any obvious casue (e.g. namespace related maybe?) for why querying xsl node-sets might break?
If needed, I will try to come up with a simple example to illustrate my problem (I cannot exactly post the code snippet of the issue since it's proprietary code).