This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
sliding window of depth 2
- From: "Américo Albuquerque" <aalbuquerque at viseu dot ipiaget dot pt>
- To: "XSL-List" <XSL-List at lists dot mulberrytech dot com>
- Date: Thu, 1 Aug 2002 18:17:40 +0100
- Subject: [xsl] sliding window of depth 2
- Reply-to: xsl-list at lists dot mulberrytech dot com
Hi!
I have a xml file with this structure:
<doc>
<node>
<book/>
<book/>
...
</node>
<node>
<book>
...
</node>
...
</doc>
I aplly to it this stylesheet
<xsl:template match="doc">
<xsl:apply-templates select="node[position()>=$start and
position()<$start+$QNT]"/>
</xsl:template>
<xsl:template match="node">
<table>
<xsl:apply-templates/>
</table>
</xsl:template>
<xsl:template match="book">
<tr>
<td>(some text here) </td>
</tr>
</xsl:template>
and I want to make a sliding window, i.e., I want to show $QNT nodes
each time strating at $start. this stylesheet does that but only to the
node nodes, i.e., it shows up to $QNT node, starting at $start, but I
also want to include the books on that count.
for example:
if start= 5 and QNT=10 then I want to apply the templates to the 10
(node|node/book) after the first 5 (node|node/book)
thanks in advance.
Américo Albuquerque
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list