This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

sliding window of depth 2


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()&lt;$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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]