xsl:iterate not executing in some cases

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

xsl:iterate not executing in some cases

David Rudel
I'm using an xsl:iterate instruction to determine the value of a variable:

<xsl:variable name="parallel.index" as="xs:double">
   <xsl:iterate select="$sorted.p.i.seq">
      <xsl:param name="value" select="1" as="xs:double"/>
      <xsl:on-completion>
      <xsl:sequence select="$value"/>
      </xsl:on-completion>
   </xsl:iterate>
</xsl:variable>

I'm receiving an error using Saxon 9.6.0.5:

XTTE0570: The value of variable $parallel.index does not satisfy the cardinality constraints

I tried the following work around:

<xsl:variable name="dummy.doc">
   <xsl:iterate select="$sorted.p.i.seq">
      <xsl:param name="value" select="1" as="xs:double"/>
      <xsl:on-completion>
      <v value="{$value}"/>
      </xsl:on-completion>
   </xsl:iterate>
</xsl:variable>
           
<xsl:variable name="parallel.index" select="$dummy.doc/v/@value" as="xs:double?"/>

This exposed that the variable was never receiving a value.

Based on further investigation, it looks like some optimization procedure notes that the interior of the iterate instruction the instruction is ignored.

-David

--

"A false conclusion, once arrived at and widely accepted is not dislodged easily, and the less it is understood, the more tenaciously it is held." - Cantor's Law of Preservation of Ignorance.

------------------------------------------------------------------------------

_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help