|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Looping on a maximum value
Suppose I have an XML fragment that looks something like:
<!-- Content -->
<items>
<item col="2">
<name>Some Name</name>
<content>Some Content</content>
</item>
<item col="4">
<name>Some Other Name</name>
<content>Some More Content</content>
</item>
<item col="3">
<name>Some New Name</name>
<content>Some Crazy Content</content>
</item>
<item col="2">
<name>Some Guy's Name</name>
<content>Some Content that is Different</content>
</item>
</items>
<!-- More Content -->
I want to do the equivalent of:
<!-- Get the highest column number and put it in an xsl variable called
numCols -->
<!-- Loop from 0 to that variable (numCols) - 1 [or 1 .. numCols] -->
<xsl:apply-templates select="item[@col=counter]" />
Does that make sense? Basically I need to get the number of columns I
will need, iterate from 1 to that number, and at each pass use the
counter to get all the items that specify that column as their col
attribute.
Thanks
Brett
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








