You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by Jose Alberto Fernandez <JF...@viquity.com> on 2000/07/17 22:52:51 UTC

Reordering long documents

Hi,

I am new to this list, so I do not know if this has been broad up before.

I want to process large documents, in particular I need to reorder some
elements in a document.
The way I currently do this s as follows:

<xsl:template match="xyz" >
  <xsl:apply-templates select="bbb">
  <xsl:apply-templates select="aaa">
  <xsl:apply-templates select="ccc">
  <xsl:apply-templates select="ddd">
</xsl:template>

<xsl:template match="aaa|bbb|ccc|ddd">
  <xsl:copy-of select="."/>
</xsl:template>

The input document's grammar is like:
  xyz ---> aaa, bbb, ccc+, ddd

and let assume you can have millions of ccc's elements (a 100 meg file is
possible).

What I would like if the XSLT to read aaa, bbb and output them in the new
order and
then just copy the ccc's and ddd's as they are. This should be very easy and
cheap on memory.
But as I understand an I empirically observed on xalan execution what really
happens is
that Xalan has to loas the entire document in memory before it realizes it
already had
all the bbb's and hence it could have started emiting output.

If only xalan new what the grammar for the input doc was....

Is there anything done on this regard? Is there any other way to code the
XSL sheet to 
get the desired output. This seem to be such a basic usage for XSL.

Thanks in advance,

Jose Alberto
PD: I am already using SAX all the way, so there is no DOM tree anywhere
around my code.



 <<Jose  Alberto Fernandez.vcf>>