Try  <http://stx.sourceforge.net/documents/spec-stx-20040701.html>
http://stx.sourceforge.net/documents/spec-stx-20070427.html 
 
It looks like the usual intimidating W3C documents, but isn't as bad as it
first seems.
 
The main difference is that you don't have 'apply-templates' which would be
a recursive rather than sequential operation. Your options are typically to
'process-children', 'process-attributes', 'process-siblings' -- these are
things that you can reference from a single location in the document while
the rest is not in memory.  
 
 

-----Original Message-----
From: Mikael Jansson [mailto:[EMAIL PROTECTED]
Sent: Friday, November 21, 2008 3:21 PM
To: xalan-j-users@xml.apache.org
Subject: Fwd: Transforming huge XML-files - 3-4GB


"Have you heard of stx?  Its a language similar in style to XSLT but it
treats the
input document as a stream of SAX events instead of loading the entire
document
into memory.  We used this to process documents of 6Gb and more.  The java
implementation is called Joost..."

OK, yeah so this looks nice.

But I can't find a good tutorial on how to convert xsl into stx documents.
Could it be so simple as to just change this:
<xsl:stylesheet version="1.0">
<xsl:output method="text"/>
<xsl:template match="posttyp">

to

<stx:stylesheet version="1.0">
<stx:output method="text"/>
<stx:template match="posttyp">
...
and so on?

I only use some of the most basic commands:
xsl:stylesheet
xsl:output method
xsl:template match
xsl:if test
xsl:apply-templates
xsl:value-of select

and thats it.

Where can I find out what the corresponding stx commands (if not the same)
are?

Micke Jansson



---------- Forwarded message ----------
From: Andy Chambers < [EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]> >
Date: Fri, Nov 21, 2008 at 23:31
Subject: Re: Transforming huge XML-files - 3-4GB
To: Mikael Jansson < [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> >



On Thu, Nov 20, 2008 at 8:31 PM, Mikael Jansson < [EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]> > wrote:
> Hi! I've already posted this, but it does not show up in the history and
> there was no response so I'll post it again. Sorry if it's a double
post...
>
> I'm trying to transform a set of XML-files into SQL-code. It works just
fine
> with XSL no mater what components I use - Stream or SAX or what ever.


Have you heard of stx?  Its a language similar in style to XSLT but it
treats the
input document as a stream of SAX events instead of loading the entire
document
into memory.  We used this to process documents of 6Gb and more.  The java
implementation is called Joost.

What's nice is that you can "call out" to a real XSLT processor by
passing fragments
of the input document to xalan or saxon if you don't want to leave the
comfort of
programming in XSLT.

Our project sounds like it was maybe pretty similar to yours.  Loading
huge wads
of XML into a database.  Word of warning though.  You're probably going to
need
every ounce of performance you can get so make sure you're using prepared
statements and you probably want to check out other XSLT processors against
your intended input.

Also consider whether its possible to avoid XML entirely.  If the database
has
a bulk-loader its almost certainly going to be quicker than parsing the XML
and
using Java to execute the SQL statements (even if you're doing
prepared statements)

--
Andy



Reply via email to