You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Roman Kunert <ku...@cs.tu-berlin.de> on 2000/05/31 01:04:08 UTC

xsp and large files

XSP and large documentsVon:
An: cocoon-users@xml.apache.org


Hello,

I've got several large documents (|person|>5000) with the following structure:

<person>
 <residence>A</residence>
 <name>ernie</name>
 <street>sesamestr.</street>
 ...
</person>
<person>
 <residence>A</residence>
 <name>bert</name>
 <street>sesamestr.</street>
 ...
</person>
<person>
 <residence>B</residence>
 <name>donald</name>
 <street>duckstr.</street>
 ...
</person>

...

the output should read like this:

<residence>A</residence>
 [all persons who live in A]

<residence>B</residence>
 [all persons who live in B]

... 

I tried to do the logic with xsp using the variable res that holds the
content of the last residence element:

<xsl:template match="person">
 <xsp:logic>
 // if there is a new residence print it...
         if( ! res.equals("<xsp:expr><xsl:value-of
select="residence"/></xsp:expr>") {
                 <residence><xsl:value-of
select="residence"/></residence>                 }
         // save this residence for future use...
         res = "<xsp:expr><xsl:value-of select="residence"/></xsp:expr>";
 </xsp:logic>
         [rest of person element]
</xsl:template>

actually this works well for small documents but for large documents the
generated method grows too big (larger than 2^16 bytes)  for the JVM.

I tried to do the same trick using xsl:param but it didn't work. Is there
another (xsp-based) solution that works for documents of any size? 

Thank you guys.

Ro.