You haven't shown any information about the transformation you are running.
It needs to follow the pattern shown at
http://www.saxonica.com/documentation/sourcedocs/serial.html
It's not necessary to start the processing at a named template ("-it main"),
but it is necessary that the large document, the one you want to process
serially, is read using the doc() or document() function, rather than
forming the principal input to the stylesheet. Although this facility uses
standard XSLT constructs, you will normally have to write the code in a
particular way for the feature to be invoked.
Michael Kay
http://www.saxonica.com/
_____
From: saxon-help-bounces@...
[mailto:saxon-help-bounces@...] On Behalf Of Fakirbaba
Sent: 31 December 2006 22:05
To: Mailing list for SAXON XSLT queries
Subject: Re: [saxon] serial processing of large documents
Michael,
Many thanks for the prompt response. As you suggested, I did the
following but still get the OutOfMemoryError. Obviously, I am not doing it
right.
1. Got the license file in c:\XML_PARSING\lib.
2. java -cp c:\XML_PARSING\lib;c:\XML_PARSING\lib\saxon8sa.jar
com.saxonica.Transform -dt -sa -o output <XML file> <XSLT file>
It's probably because I am not using the "-it main" option. I tried to use
it but I got an error saying "There is no named template with expanded name
main." I must admit that my XSLT knowledge is a bit rusty. I wrote these
XSLTs about a year ago and I already forgot quite a bit. Do I need to make
changes to my XSLT for it to work with SAXON-SA with the "-it main" option?
Thanks
Michael Kay <mike@...> wrote:
The API for invoking the transformation is exactly the same as always. You
need to install Saxon-SA, you need the saxon-sa.jar file and the directory
containing the license file on your classpath, and you need to ensure that
you actually use Saxon-SA, either by using the entry point
com.saxonica.Transform or by using net.sf.saxon.Transform with the -sa
option on the command line; or if you are working from the Java API,
instantiate the schema-aware version of the transformer factory,
com.saxonica.TransformerFactoryImpl.
The problems with your command line are (a) that it's not invoking Saxon-SA,
(b) that it doesn't put the license file on the classpath, and (c) that if
you specify the -it option, then the <XML file> must be omitted.
Michael Kay
http://www.saxonica.com/
_____
From: saxon-help-bounces@...
[mailto:saxon-help-bounces@...] On Behalf Of Fakirbaba
Sent: 30 December 2006 22:37
To: saxon-help@...
Subject: [saxon] serial processing of large documents
Hi,
I used SAXON8 in one of my projects to transform big XML sources into
text files. The problem that I am facing is that whenever I have a very
large file, I have to increase the JVM heap size (java -Xmx512m, -Xmx1024m,
etc.), othersie, I get the OutOfMemoryException. I am afraid the size of
the source XML will increase more. So, I started to do some research to
find a remedy of this problem. And I found that SAXON8SA might have a
remedy through "Serial processing of large documents". But I am not sure
how I can take advantage of that through Java API or even from the command
line. I tried the following:
java -cp lib\saxon8sa.jar net.sf.saxon.Transform -dt -it main -o output <XML
file> <XSLT file>
But I get the usage. It doesn't like the -it main option.
Any help on this would be greatly appreciated.
Thanks,
Fakir
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV___
____________________________________________
saxon-help mailing list
saxon-help@...
https://lists.sourceforge.net/lists/listinfo/saxon-help
|