Order of nodes in xsl:for-each nodeset (Xalan-J)

B

Brian J. Sayatovic

I'm using Xalan-J to loop through some nodes with an xsl:for-each
element, presumably in document order. As far as I can tell, the XSL
speciciation says that a for-each element will loop through the
nodeset in document order, meaning the order the elements occur in the
document. Does Xalan-J obey this rule?

I'm encountering some oddities that could be explained if Xalan-J does
not adhere to this, but it is a very rare circumstance, so its hard to
test.

Regards,
Brian.
 
M

Martin Honnen

Brian said:
I'm using Xalan-J to loop through some nodes with an xsl:for-each
element, presumably in document order. As far as I can tell, the XSL
speciciation says that a for-each element will loop through the
nodeset in document order, meaning the order the elements occur in the
document. Does Xalan-J obey this rule?

I'm encountering some oddities that could be explained if Xalan-J does
not adhere to this, but it is a very rare circumstance, so its hard to
test.

The XSLT 1.0 specification says about xsl:for-each:

The nodes are processed in document order, unless a sorting
specification is present.

I don't know whether Xalan-J has some bug, that might depend on the
version of it. Do you get different results for the same XML document
and XSL document when you try another XSLT processor?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,050
Latest member
AngelS122

Latest Threads

Top