This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
unions, for-each, document order
- To: xsl-list at mulberrytech dot com
- Subject: unions, for-each, document order
- From: Steve Morrison <smorrison at gte dot com>
- Date: Wed, 02 Aug 2000 16:20:48 -0400
- Reply-To: xsl-list at mulberrytech dot com
So, I have a set of nodes each called <cat>. The <cat> tag has an attribute called level, which is either 0 or 1. The <cat>s come in alphabetical order, and ones with level="1" or level="0" can occur at any point. I need to process these in such a way that it applies a template to the level="1"'s first, then the level="0"'s. I then do another round of suppression/selection based on some other attributes.
This would do exactly what I want:
<xsl:for-each select="cat[@level = 1] | cat[@level = 0]">
<xsl:if test="sometest based on parent nodes">
<!-- create html -->
</xsl:if>
</xsl:for-each>
except, the for-each and apply-templates goes in document order, as opposed to copy-of, which applies the union in the order I specify in the select! Is there another way around this? I tried using two different for-each loops, but, then that messes up my inner <xsl:if> test.
Thanks,
-Steve
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list