Re: [xsl] Q on incremental processing and count()

Subject: Re: [xsl] Q on incremental processing and count()
From: Enke Michael <Michael.Enke@xxxxxxxxxxxxxxxxxx>
Date: Tue, 19 Feb 2002 08:50:20 +0100
Perry Molendijk wrote:
> 
> Infexions (WA) Pty LtdWouldn't give you the result you're after, no need for
> count() etc..

Hi Perry,
I described 2 problems in one posting. So count() was another problem
(but showed the same result).
To the code fragment you posted here:
Look at the xsl:for-each:
If I write (as you wrote):
<xsl:for-each select=". | following-sibling::row[position() &lt; 20]">
Than all the generated html come out of Xalan-j after processing all rows!
That means after 100 seconds (using 0.5 seconds per row, having 200 rows)
This is my point.
If I write:
<xsl:for-each select=".">
Than I have only the first row of each subtable, BUT:
I see the result IMMEDIATELY after processing only this piece of xml!
So I see the first table (only row number 1) after 10 seconds,
I see the second table (only row number 21) after additional 10 seconds and so on.

Do you see my point?

Regards,
Michael

> <?xml version="1.0" encoding="UTF-8"?>
> <xsl:stylesheet version="1.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
>  <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
>  <xsl:template match="/">
>   <html>
>    <head>
>     <title>unique news</title>
>    </head>
>    <body>
>     <xsl:apply-templates select="/table/row[position() mod 20 = 1]"/>
>    </body>
>   </html>
>  </xsl:template>
>  <xsl:template match="row">
>   <table border="2" cellpadding="4">
>    <tr style="background-color:orange">
>     <th>table header</th>
>    </tr>
>    <xsl:for-each select=". | following-sibling::row[position() &lt; 20]">
>     <tr>
>      <td>
>       <xsl:value-of select="."/>
>      </td>
>     </tr>
>    </xsl:for-each>
>   </table>
>   <p/>
>  </xsl:template>
> </xsl:stylesheet>
> 
> That seemed to work pretty well in MSXML 3, Saxon and Xalan
> 
> Perry
> 
> ----- Original Message -----
> From: "Enke Michael" <Michael.Enke@xxxxxxxxxxxxxxxxxx>
> To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
> Sent: Monday, February 18, 2002 10:30 PM
> Subject: Re: [xsl] Q on incremental processing and count()
> 
> > Joerg Heinicke wrote:
> > >
> > > Hello Michael,
> > >
> > > it's not clear what you want to do. Your variables are ok, no problems
> to
> > > see. You only can shorten them:
> > >
> > > <xsl:variable name="col-num" select="10"/>
> > >
> > > <xsl:variable name="col-num" select="count(thead/th-row)"/>
> > >
> > > <xsl:variable name="col-num" select="count(thead[1]/th-row)"/>
> > >
> > > Between the two last declarations there should be no difference, because
> of
> > > your XML.
> > >
> > > But what exactly is the problem? What's the result you get and you
> expect?
> > > What's the context of the variable declaration?
> > >
> > > Regards,
> > >
> > > Joerg
> > >
> > >  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> >
> > My problem is the execution speed.
> > I have a large table (200 entries) and split them into small tables (per
> > table 20 entries, every subtable with the same table header).
> > My problem is: The browser gets the result if all 200 entries are
> processed in
> > the memory! Arrrrgggg...
> > But I expected to see the tables as they come out of the database.
> > Because for investigating I made it so, that every item needs half a
> second
> > to be generated.
> > I expected to see the first sub table after 20*0.5 seconds, the second
> table
> > after 2*20*0.5 seconds and so on.
> > But actually I see all tables not before 200*0.5 seconds :-(
> >
> > If I remove the count() and ...following-sibling... I lost my
> > table structure but I can see how the values come out as they
> > were produced.
> >
> > Regards,
> > Michael
> >
> >  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> >
> >
> 
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread