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]

Re: Q on incremental processing and count()




Jeni Tennison wrote:

>
>However, from the symptoms that you describe (I'm guessing here - I
>don't know how Xalan works internally), as soon as you do include a
>count() function, Xalan thinks that the stylesheet involves using
>information that is not yet accessible to it, and so reverts to the
>more common processing model where it constructs the whole source tree
>prior to transformation.
>
Independant of the way xalan-j is working, it is not possible for an 
incremental processor to output the result of a call to the count 
function before the expression inside the count() is completely 
evaluated. E.g.:

<xsl:template match="table">
  <xsl:value-of select="count(thead/th-c)"/>
</xsl:template>

Here, the result of the call to count() is only available at the end of the table, as it is not known before how much th-c elements will be contained inside thead elements in the table element.

>From a processing point of view the second xpath that Michael proposed (count(thead[1]/th-c)) should do the right job, as the processor does not have to wait until the end of the table element, but just until the end of the first thead element (which should be the only one).
It seems that xalan does not output as soon as would be possible in this case.

Regards,
  Tobias



 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]