Hi all,

In one of my scripts, a parameter inside xsl:iterate is not being set to its initial value.

The segment of the script in question is shown below:

<xsl:iterate select="descendant::item">
                        <xsl:param name="previousfacts" select="../preceding-sibling::element()[item]/descendant::item[@type='fact']/@id" as="xs:string*"/>
                        <debug readout1="{count($previousfacts)}"

When I run this script I get the following output for the first item processed:

<debug readout1="0" readout2="" readout3="15 30 171 42 14 30 3 199 222 71 172 199 79 71 42 300 199 11"/>

It seems that "previousfacts" is being initialized as an empty sequence even though the Xpath expression inside its select attribute provides a sequence of 18 items.
I've tried omitting the "as" attribute, and I've also tried creating a sequence constructor and also tried using "for $i in ../preceding-sibling::element()[item]/descendant::item[@type='fact'] return $i/@id"  None of them manage to cause the sequence to initialize as anything other than the empty sequence.

I realize I'm not sending the whole script or the source file, etc., but I'm hoping the above is enough for someone to figure out what I'm doing wrong.



"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.