Title: AW: IDREFS sorting

Gary,

you wrote:
> See http://www.w3.org/TR/xslt#for-each.  It indicates that
> xsl:for-each
> processes the nodes in document order, as you are seeing.

Yes, your're right. "http://www.w3.org/TR/xslt#for-each" defines:
"The nodes are processed in document order".

But...: XALAN does _NOT_ process the nodes in document order.
(In my example, the nodes have the same document order as in the IDREFS attribute.)

So we've got trouble on both sides:
1) for-each working with IDREFS is not working as I need it ... so I've got
        some extra work to do
2) XALAN is not working as the specification defines...

Cheers!

Jens

PS: I know, it's hard to believe.. I browsed the FuncID source and found the
line you meant:

if (null != node)
          nodeSet.addNodeInDocOrder(node, xctxt);

But I'm sorry, this doesn't work. Here's an XSLT test fragment:
--------------------8X--------------------8X--------------------
<xsl:template match="Liste">
        <p>Items in docuement order using for-each on children</p>
        <ol>
        <xsl:for-each select="Item">
                <li><xsl:value-of select="@OID"/>: <xsl:value-of select="Name"/></li>
        </xsl:for-each>
        </ol>
               
        <p>Items in docuement order using the IDREFS</p>
        <p>Liste: "<xsl:value-of select="@IDList"/>"</p>
        <ol>
        <xsl:for-each select="id(@IDList)">
                <li><xsl:value-of select="@OID"/>: <xsl:value-of select="Name"/></li>
        </xsl:for-each>
        </ol>
</xsl:template>
--------------------8X--------------------8X--------------------

If XALAN is working correct, both ordered lists must be equal. Here's my output:
--------------------8X--------------------8X--------------------
<p>Items in docuement order using for-each on children</p>
<ol>
        <li>_326: S0</li>
        <li>_336: S1</li>
        <li>_330: S2</li>
</ol>
<p>Items in docuement order using the IDREFS</p>
<p>Liste: "_326 _336 _330"</p>
<ol>
        <li>_326: S0</li>
        <li>_330: S2</li>
        <li>_336: S1</li>
</ol>
--------------------8X--------------------8X--------------------

As you can see: the lists differ.

Reply via email to