xsl-list
[Top] [All Lists]

RE: How to transform a huge XML-file (memory-saving)?

2005-08-11 15:14:38
You could try the new facility in Saxon-SA 8.5 to process the file
sequentially. Whether this is possible depends on precisely how you want to
transform each OBJECT element. It's not entirely clear what you mean when
you say that you "have to link between the data-blocks".

Michael Kay
http://www.saxonica.com/ 

-----Original Message-----
From: news(_at_)swisslab(_dot_)de [mailto:news(_at_)swisslab(_dot_)de] 
Sent: 09 August 2005 14:49
To: 'xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com'
Subject: [xsl] How to transform a huge XML-file (memory-saving)?

Hello List,

i'm looking for a solution to handle the xslt-transformation 
of huge data
files.
If i try to process a 176 mb XML-file with saxon8, the java 
enviroment uses
a lot of main-memory - round about 1 gb.
This XML-file contains a always repeating block of a 
structure like this:

    <OBJECT R='XMLEXPBE'>
      <AUFNR>0000463105</AUFNR>
      <AUFDAT>28.11.2000</AUFDAT>
      <FALNR>0200036273</FALNR>
      <MAT>EBLUT</MAT>
      <ANFO>BG</ANFO>
      <UNT>AB0</UNT>
      <ERG>A</ERG>
      <USER>JO</USER>
    </OBJECT>

To process this XML-structure, i used a normal template 
structure like this:

<xsl:template match="/">  
  <!--<xsl:call-template name="XmlInfo"/>-->  
  <xsl:apply-templates select="//OBJECT" mode="Bestimmungen"/>  
</xsl:template>

<xsl:template match="OBJECT" mode="Bestimmungen">
 
<xsl:text>MSH|^~\&amp;|||||||ZBM|</xsl:text><xsl:text>&#13;&#1
0;</xsl:text>
 ...........
</xsl:template>


I expect to get a much larger data-file soon. So i think, i will get a
problem with the main memory capacity.
To split the file isn't a possibility, because i have to link 
between the
data-blocks.

Has anybody an idea, whether an more effective (less memory) way of
programming exists?

I tried to use <xsl:key ...> and the key()-function to built 
an index. But
it doesn't fit in the <xsl:template ...> - enviroment.
Is it possible to bring both concepts together?

Thanks a lot!
Andrej.

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--





--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--