|
Subject: Re: [xsl] efficiently detecting size of input document? From: "Andrew Welch" <andrew.j.welch@xxxxxxxxx> Date: Thu, 14 Aug 2008 10:43:56 +0100 |
> For (2), the challenge would be how to process the first [certain
> amount] of the document and no more, again without inefficiently
> counting nodes.
Do a sibling-recursion identity transform:
<xsl:template match="node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()[1]"/>
</xsl:copy>
<xsl:apply-templates select="following-sibling::node()[1]"/>
</xsl:template>
<xsl:template match="@*">
<xsl:copy/>
</xsl:template>
Just add a parameter which maintains the count...
--
Andrew Welch
http://andrewjwelch.com
Kernow: http://kernowforsaxon.sf.net/
| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| [xsl] efficiently detecting size of, Lars Huttar | Thread | [xsl] SV: xsl-list Digest 14 Aug 20, Kjellaug Johansen |
| Re: [xsl] Cost of complex match pat, Vladimir Nesterovsky | Date | Re: [xsl] position and loop problem, Florent Georges |
| Month |