You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-dev@xmlgraphics.apache.org by Jeremias Maerki <je...@outline.ch> on 2002/03/22 16:49:40 UTC

Fw: Re: Rendering from a Document

<comment>Oops, that one didn't make it to the list at first.</comment>

DOM (Document) should work. But using DOM to process a 400MB XML? You
wouldn't want to do that. Try to find a way to use SAX. You can fill SAX
events into FOP to create the FO tree. Maybe it helps us to provide you
with some pointers and ideas if you tell us what exactly you're trying
to do.

> 	I'm sorry to post this again but I need help.  Does passing a Document datatype to the Driver
> render() method work?  I have to potential to move XML files in excess of 400MB and so I need to avoid as
> moving of data in memory as possible.

Cheers,
Jeremias Märki

mailto:jeremias.maerki@outline.ch

OUTLINE AG
Postfach 3954 - Rhynauerstr. 15 - CH-6002 Luzern
Tel. +41 41 317 2020 - Fax +41 41 317 2029
Internet http://www.outline.ch


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org


Re: Re: Rendering from a Document

Posted by "David B. Bitton" <da...@codenoevil.com>.
Here's an update, and a potential bug.  The NPE was actually resulting from
an improper transformation of the XML.  The Element object passed in by
Apache SOAP needs to "promoted" to Document object status prior to being
passes to the transform in a DOMSource object.  This is accomplished with
the follow:

    Transformer transformer = tFactory.newTransformer( new StreamSource(
xsl_url ) );

    DocumentBuilderFactory dBuilderFactory =
DocumentBuilderFactory.newInstance();
    DocumentBuilder docBuilder = dBuilderFactory.newDocumentBuilder();
    Document doc = docBuilder.newDocument();
    Node newNode = doc.importNode( element, true );
    doc.appendChild( newNode );

    transformer.transform( new DOMSource( doc ), new SAXResult(
driver.getContentHandler() ));

    This produces a nice PDF.  I notice that by doing this, I do not have to
call the run() method, so therefore I'm assuming that this saves a step in
the entire rendering process.  Please correct me if I'm wrong, but am I to
believe that the PDF is being rendered as the SAX events are being fired by
the transformer?  By this, it seems like this should save me alot of memory
usage because I won't have to hold the XSL:FO output in an object.

    I am very happy with the way this is turning out.  I promise an article
on it as soon as I'm finished.y


--

David B. Bitton
david@codenoevil.com
www.codenoevil.com

Code Made Fresh DailyT
----- Original Message -----
From: "Jeremias Maerki" <je...@outline.ch>
To: <fo...@xml.apache.org>
Sent: Friday, March 22, 2002 10:49 AM
Subject: Fw: Re: Rendering from a Document


> <comment>Oops, that one didn't make it to the list at first.</comment>
>
> DOM (Document) should work. But using DOM to process a 400MB XML? You
> wouldn't want to do that. Try to find a way to use SAX. You can fill SAX
> events into FOP to create the FO tree. Maybe it helps us to provide you
> with some pointers and ideas if you tell us what exactly you're trying
> to do.
>
> > I'm sorry to post this again but I need help.  Does passing a Document
datatype to the Driver
> > render() method work?  I have to potential to move XML files in excess
of 400MB and so I need to avoid as
> > moving of data in memory as possible.
>
> Cheers,
> Jeremias Märki
>
> mailto:jeremias.maerki@outline.ch
>
> OUTLINE AG
> Postfach 3954 - Rhynauerstr. 15 - CH-6002 Luzern
> Tel. +41 41 317 2020 - Fax +41 41 317 2029
> Internet http://www.outline.ch
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
> For additional commands, email: fop-dev-help@xml.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org


Re: Rendering from a Document

Posted by "David B. Bitton" <da...@codenoevil.com>.
Ok,
	I'm doing this:

Transformer transformer = tFactory.newTransformer( new StreamSource( xsl_url ) );
transformer.transform( new DOMSource( source ), new SAXResult( driver.getContentHandler() ));

and I'm getting javax.xml.transform.TransformerException: java.lang.NullPointerException.

this is last point of execution in the stack trace:

at org.apache.fop.fo.pagination.PageSequence.<init>(PageSequence.java:144)

Do you, or anyone know why this would be?  Also, once this runs, do I call driver.run()?

On Fri, Mar 22, 2002 at 05:59:26PM +0100, Jeremias Maerki wrote:
> > I was just looking at the FOP API JavaDocs.  Can I use getContentHanlder from the Driver object, send that
> > into the transformer wrapped in a SAXResults object?  Will this populate FOP with the required data to do
> > the XSL:FO transform?
> 
> You got it!!!!! That's just what I was about to suggest.
> 
> > On Fri, Mar 22, 2002 at 11:22:12AM -0500, David B. Bitton wrote:
> > > 1000/N
> > > Status: O
> > > X-Status: 
> > > X-Keywords:                  
> > > X-UID: 600
> > > 
> > > Ok this is what I'm doing:
> > > 
> > > I produce an XML file from data stored on a mainframe.  The XML is generate in a VB object.  The XML is
> > > passed up to an ASP page that makes a Low Level API SOAP call, using MSSOAP Toolkit 2.0,  to my PDF server.
> > > The PDF server is running Tomcat 4/Apache SOAP 2.2.
> 
> Concerning Apache SOAP 2.2: You might want to have a look at Axis
> (http://xml.apache.org/axis) which is a floolow-on for SOAP 2.2. I think
> I heard once that it is based on SAX rather than DOM. Haven't tested it,
> though.
> 
> > > 
> > > On the PDF server, I receive the XML as literalxml in the envelope, fetch a stylesheet, pass the Element
> > > object to a Xalan 2.3 transformer (wrapped in a DOMSource object), and then transform the XML into XSL:FO
> > > objects.  
> > > 
> > > Now I have a Document object that was returned from the transformer wrapped in a DOMResults object.  The
> > > next step is where the problem lies.  I want to pass the Document to a Driver, but I get the dreaded
> > > NullPointerException.
> > > 
> > > Most of the time, the XML is will be small ( 5 - 7K), but there is a potention for an account to have 5 to
> > > 10 thousand transactions in a day, and we store up to 63 days of data (a single transaction in XML is 594
> > > bytes, therefore a 630K transaction XML file would be 374MB, plus some extra data at the top).  So you can
> > > see what I have the potential to deal with.
> > > 
> > > What I don't even know is how FOP will handle this.  The XSL:FO file is sure to be much larger than 380MB.
> > > I transformer a 6.66KB XML file and it produced a XSL:FO file of 16.2KB.  If we use that as a benchmark,
> > > than the same 374MB would become 909.8MB.  That's a whole lot of RAM, not to mention what FOP is going to
> > > use to store the rendered PDF.
> 
> I hope you will be lucky. Some have reported that big documents work
> well. Others were not so lucky. As long as there are not many references
> in your documents you should get quite far. You can browse the archives.
> There has been a number of discussions on this topic.
> 
> > > I'm hoping that someone can poke a hole in these numbers (please), because this is getting to look a whole
> > > lot bigger than expected.  Obviously performance and resource utilization are major concernes (like when are
> > > they not?).  Obviously SAX for this would be faster because it wouldn't require loading the entire XML
> > > contents into memory.
> > > 
> > > So, now is here the questions come in.  Do I return from the transform a SAXResults?  Also, how do I
> > > effectively handle the incoming XML into the SOAP method?  I would prefer to send the XML in literalxml
> > > format so the < and > are HTML encoded (increasing the size of the content even more).
> > > 
> > > Where do I go from here?
> > > 
> > > 
> > > On Fri, Mar 22, 2002 at 04:49:40PM +0100, Jeremias Maerki wrote:
> > > > <comment>Oops, that one didn't make it to the list at first.</comment>
> > > > 
> > > > DOM (Document) should work. But using DOM to process a 400MB XML? You
> > > > wouldn't want to do that. Try to find a way to use SAX. You can fill SAX
> > > > events into FOP to create the FO tree. Maybe it helps us to provide you
> > > > with some pointers and ideas if you tell us what exactly you're trying
> > > > to do.
> > > > 
> > > > > 	I'm sorry to post this again but I need help.  Does passing a Document datatype to the Driver
> > > > > render() method work?  I have to potential to move XML files in excess of 400MB and so I need to avoid as
> > > > > moving of data in memory as possible.
> 
> Cheers,
> Jeremias M?rki
> 
> mailto:jeremias.maerki@outline.ch
> 
> OUTLINE AG
> Postfach 3954 - Rhynauerstr. 15 - CH-6002 Luzern
> Tel. +41 41 317 2020 - Fax +41 41 317 2029
> Internet http://www.outline.ch
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
> For additional commands, email: fop-dev-help@xml.apache.org

-- 

David B. Bitton
david@codenoevil.com

Diversa ab illis virtute valemus.

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org


Re: Rendering from a Document

Posted by "David B. Bitton" <da...@codenoevil.com>.
For posterty's sake, here's the full stacktrace:

java.lang.NullPointerException
	at org.apache.fop.fo.pagination.PageSequence.<init>(PageSequence.java:144)
	at org.apache.fop.fo.pagination.PageSequence$Maker.make(PageSequence.java:43)
	at org.apache.fop.fo.FOTreeBuilder.startElement(FOTreeBuilder.java:261)
	at org.apache.xalan.transformer.ResultTreeHandler.flushElem(ResultTreeHandler.java:858)
	at org.apache.xalan.transformer.ResultTreeHandler.flushPending(ResultTreeHandler.java:952)
	at org.apache.xalan.transformer.ResultTreeHandler.endElement(ResultTreeHandler.java:306)
	at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:716)
	at org.apache.xalan.templates.ElemApplyTemplates.transformSelectedNodes(ElemApplyTemplates.java:422)
	at org.apache.xalan.templates.ElemApplyTemplates.execute(ElemApplyTemplates.java:226)
	at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2243)
	at org.apache.xalan.transformer.TransformerImpl.applyTemplateToNode(TransformerImpl.java:2069)
	at org.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.java:1171)
	at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:634)
	at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1088)
	at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1066)
	at com.banklink.ilink.Renderer.transformXML(Renderer.java:230)
	at com.banklink.ilink.Renderer.Render(Renderer.java:135)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:324)
	at org.apache.soap.server.RPCRouter.invoke(RPCRouter.java:146)
	at org.apache.soap.providers.RPCJavaProvider.invoke(RPCJavaProvider.java:129)
	at org.apache.soap.server.http.RPCRouterServlet.doPost(RPCRouterServlet.java:287)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
	at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:190)
	at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
	at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
	at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
	at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2343)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
	at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
	at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
	at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
	at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
	at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468)
	at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
	at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
	at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1012)
	at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1107)
	at java.lang.Thread.run(Thread.java:536)

If anything, this is makes for good Google keyword searching.

On Fri, Mar 22, 2002 at 05:59:26PM +0100, Jeremias Maerki wrote:
> > I was just looking at the FOP API JavaDocs.  Can I use getContentHanlder from the Driver object, send that
> > into the transformer wrapped in a SAXResults object?  Will this populate FOP with the required data to do
> > the XSL:FO transform?
> 
> You got it!!!!! That's just what I was about to suggest.
> 
> > On Fri, Mar 22, 2002 at 11:22:12AM -0500, David B. Bitton wrote:
> > > 1000/N
> > > Status: O
> > > X-Status: 
> > > X-Keywords:                  
> > > X-UID: 600
> > > 
> > > Ok this is what I'm doing:
> > > 
> > > I produce an XML file from data stored on a mainframe.  The XML is generate in a VB object.  The XML is
> > > passed up to an ASP page that makes a Low Level API SOAP call, using MSSOAP Toolkit 2.0,  to my PDF server.
> > > The PDF server is running Tomcat 4/Apache SOAP 2.2.
> 
> Concerning Apache SOAP 2.2: You might want to have a look at Axis
> (http://xml.apache.org/axis) which is a floolow-on for SOAP 2.2. I think
> I heard once that it is based on SAX rather than DOM. Haven't tested it,
> though.
> 
> > > 
> > > On the PDF server, I receive the XML as literalxml in the envelope, fetch a stylesheet, pass the Element
> > > object to a Xalan 2.3 transformer (wrapped in a DOMSource object), and then transform the XML into XSL:FO
> > > objects.  
> > > 
> > > Now I have a Document object that was returned from the transformer wrapped in a DOMResults object.  The
> > > next step is where the problem lies.  I want to pass the Document to a Driver, but I get the dreaded
> > > NullPointerException.
> > > 
> > > Most of the time, the XML is will be small ( 5 - 7K), but there is a potention for an account to have 5 to
> > > 10 thousand transactions in a day, and we store up to 63 days of data (a single transaction in XML is 594
> > > bytes, therefore a 630K transaction XML file would be 374MB, plus some extra data at the top).  So you can
> > > see what I have the potential to deal with.
> > > 
> > > What I don't even know is how FOP will handle this.  The XSL:FO file is sure to be much larger than 380MB.
> > > I transformer a 6.66KB XML file and it produced a XSL:FO file of 16.2KB.  If we use that as a benchmark,
> > > than the same 374MB would become 909.8MB.  That's a whole lot of RAM, not to mention what FOP is going to
> > > use to store the rendered PDF.
> 
> I hope you will be lucky. Some have reported that big documents work
> well. Others were not so lucky. As long as there are not many references
> in your documents you should get quite far. You can browse the archives.
> There has been a number of discussions on this topic.
> 
> > > I'm hoping that someone can poke a hole in these numbers (please), because this is getting to look a whole
> > > lot bigger than expected.  Obviously performance and resource utilization are major concernes (like when are
> > > they not?).  Obviously SAX for this would be faster because it wouldn't require loading the entire XML
> > > contents into memory.
> > > 
> > > So, now is here the questions come in.  Do I return from the transform a SAXResults?  Also, how do I
> > > effectively handle the incoming XML into the SOAP method?  I would prefer to send the XML in literalxml
> > > format so the < and > are HTML encoded (increasing the size of the content even more).
> > > 
> > > Where do I go from here?
> > > 
> > > 
> > > On Fri, Mar 22, 2002 at 04:49:40PM +0100, Jeremias Maerki wrote:
> > > > <comment>Oops, that one didn't make it to the list at first.</comment>
> > > > 
> > > > DOM (Document) should work. But using DOM to process a 400MB XML? You
> > > > wouldn't want to do that. Try to find a way to use SAX. You can fill SAX
> > > > events into FOP to create the FO tree. Maybe it helps us to provide you
> > > > with some pointers and ideas if you tell us what exactly you're trying
> > > > to do.
> > > > 
> > > > > 	I'm sorry to post this again but I need help.  Does passing a Document datatype to the Driver
> > > > > render() method work?  I have to potential to move XML files in excess of 400MB and so I need to avoid as
> > > > > moving of data in memory as possible.
> 
> Cheers,
> Jeremias M?rki
> 
> mailto:jeremias.maerki@outline.ch
> 
> OUTLINE AG
> Postfach 3954 - Rhynauerstr. 15 - CH-6002 Luzern
> Tel. +41 41 317 2020 - Fax +41 41 317 2029
> Internet http://www.outline.ch
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
> For additional commands, email: fop-dev-help@xml.apache.org

-- 

David B. Bitton
david@codenoevil.com

Diversa ab illis virtute valemus.

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org


Re: Rendering from a Document

Posted by Jeremias Maerki <je...@outline.ch>.
> I was just looking at the FOP API JavaDocs.  Can I use getContentHanlder from the Driver object, send that
> into the transformer wrapped in a SAXResults object?  Will this populate FOP with the required data to do
> the XSL:FO transform?

You got it!!!!! That's just what I was about to suggest.

> On Fri, Mar 22, 2002 at 11:22:12AM -0500, David B. Bitton wrote:
> > 1000/N
> > Status: O
> > X-Status: 
> > X-Keywords:                  
> > X-UID: 600
> > 
> > Ok this is what I'm doing:
> > 
> > I produce an XML file from data stored on a mainframe.  The XML is generate in a VB object.  The XML is
> > passed up to an ASP page that makes a Low Level API SOAP call, using MSSOAP Toolkit 2.0,  to my PDF server.
> > The PDF server is running Tomcat 4/Apache SOAP 2.2.

Concerning Apache SOAP 2.2: You might want to have a look at Axis
(http://xml.apache.org/axis) which is a floolow-on for SOAP 2.2. I think
I heard once that it is based on SAX rather than DOM. Haven't tested it,
though.

> > 
> > On the PDF server, I receive the XML as literalxml in the envelope, fetch a stylesheet, pass the Element
> > object to a Xalan 2.3 transformer (wrapped in a DOMSource object), and then transform the XML into XSL:FO
> > objects.  
> > 
> > Now I have a Document object that was returned from the transformer wrapped in a DOMResults object.  The
> > next step is where the problem lies.  I want to pass the Document to a Driver, but I get the dreaded
> > NullPointerException.
> > 
> > Most of the time, the XML is will be small ( 5 - 7K), but there is a potention for an account to have 5 to
> > 10 thousand transactions in a day, and we store up to 63 days of data (a single transaction in XML is 594
> > bytes, therefore a 630K transaction XML file would be 374MB, plus some extra data at the top).  So you can
> > see what I have the potential to deal with.
> > 
> > What I don't even know is how FOP will handle this.  The XSL:FO file is sure to be much larger than 380MB.
> > I transformer a 6.66KB XML file and it produced a XSL:FO file of 16.2KB.  If we use that as a benchmark,
> > than the same 374MB would become 909.8MB.  That's a whole lot of RAM, not to mention what FOP is going to
> > use to store the rendered PDF.

I hope you will be lucky. Some have reported that big documents work
well. Others were not so lucky. As long as there are not many references
in your documents you should get quite far. You can browse the archives.
There has been a number of discussions on this topic.

> > I'm hoping that someone can poke a hole in these numbers (please), because this is getting to look a whole
> > lot bigger than expected.  Obviously performance and resource utilization are major concernes (like when are
> > they not?).  Obviously SAX for this would be faster because it wouldn't require loading the entire XML
> > contents into memory.
> > 
> > So, now is here the questions come in.  Do I return from the transform a SAXResults?  Also, how do I
> > effectively handle the incoming XML into the SOAP method?  I would prefer to send the XML in literalxml
> > format so the < and > are HTML encoded (increasing the size of the content even more).
> > 
> > Where do I go from here?
> > 
> > 
> > On Fri, Mar 22, 2002 at 04:49:40PM +0100, Jeremias Maerki wrote:
> > > <comment>Oops, that one didn't make it to the list at first.</comment>
> > > 
> > > DOM (Document) should work. But using DOM to process a 400MB XML? You
> > > wouldn't want to do that. Try to find a way to use SAX. You can fill SAX
> > > events into FOP to create the FO tree. Maybe it helps us to provide you
> > > with some pointers and ideas if you tell us what exactly you're trying
> > > to do.
> > > 
> > > > 	I'm sorry to post this again but I need help.  Does passing a Document datatype to the Driver
> > > > render() method work?  I have to potential to move XML files in excess of 400MB and so I need to avoid as
> > > > moving of data in memory as possible.

Cheers,
Jeremias Märki

mailto:jeremias.maerki@outline.ch

OUTLINE AG
Postfach 3954 - Rhynauerstr. 15 - CH-6002 Luzern
Tel. +41 41 317 2020 - Fax +41 41 317 2029
Internet http://www.outline.ch


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org


Re: Fw: Re: Rendering from a Document

Posted by "David B. Bitton" <da...@codenoevil.com>.
I was just looking at the FOP API JavaDocs.  Can I use getContentHanlder from the Driver object, send that
into the transformer wrapped in a SAXResults object?  Will this populate FOP with the required data to do
the XSL:FO transform?

On Fri, Mar 22, 2002 at 11:22:12AM -0500, David B. Bitton wrote:
> 1000/N
> Status: O
> X-Status: 
> X-Keywords:                  
> X-UID: 600
> 
> Ok this is what I'm doing:
> 
> I produce an XML file from data stored on a mainframe.  The XML is generate in a VB object.  The XML is
> passed up to an ASP page that makes a Low Level API SOAP call, using MSSOAP Toolkit 2.0,  to my PDF server.
> The PDF server is running Tomcat 4/Apache SOAP 2.2.
> 
> On the PDF server, I receive the XML as literalxml in the envelope, fetch a stylesheet, pass the Element
> object to a Xalan 2.3 transformer (wrapped in a DOMSource object), and then transform the XML into XSL:FO
> objects.  
> 
> Now I have a Document object that was returned from the transformer wrapped in a DOMResults object.  The
> next step is where the problem lies.  I want to pass the Document to a Driver, but I get the dreaded
> NullPointerException.
> 
> Most of the time, the XML is will be small ( 5 - 7K), but there is a potention for an account to have 5 to
> 10 thousand transactions in a day, and we store up to 63 days of data (a single transaction in XML is 594
> bytes, therefore a 630K transaction XML file would be 374MB, plus some extra data at the top).  So you can
> see what I have the potential to deal with.
> 
> What I don't even know is how FOP will handle this.  The XSL:FO file is sure to be much larger than 380MB.
> I transformer a 6.66KB XML file and it produced a XSL:FO file of 16.2KB.  If we use that as a benchmark,
> than the same 374MB would become 909.8MB.  That's a whole lot of RAM, not to mention what FOP is going to
> use to store the rendered PDF.
> 
> I'm hoping that someone can poke a hole in these numbers (please), because this is getting to look a whole
> lot bigger than expected.  Obviously performance and resource utilization are major concernes (like when are
> they not?).  Obviously SAX for this would be faster because it wouldn't require loading the entire XML
> contents into memory.
> 
> So, now is here the questions come in.  Do I return from the transform a SAXResults?  Also, how do I
> effectively handle the incoming XML into the SOAP method?  I would prefer to send the XML in literalxml
> format so the < and > are HTML encoded (increasing the size of the content even more).
> 
> Where do I go from here?
> 
> 
> On Fri, Mar 22, 2002 at 04:49:40PM +0100, Jeremias Maerki wrote:
> > <comment>Oops, that one didn't make it to the list at first.</comment>
> > 
> > DOM (Document) should work. But using DOM to process a 400MB XML? You
> > wouldn't want to do that. Try to find a way to use SAX. You can fill SAX
> > events into FOP to create the FO tree. Maybe it helps us to provide you
> > with some pointers and ideas if you tell us what exactly you're trying
> > to do.
> > 
> > > 	I'm sorry to post this again but I need help.  Does passing a Document datatype to the Driver
> > > render() method work?  I have to potential to move XML files in excess of 400MB and so I need to avoid as
> > > moving of data in memory as possible.
> > 
> > Cheers,
> > Jeremias M?rki
> > 
> > mailto:jeremias.maerki@outline.ch
> > 
> > OUTLINE AG
> > Postfach 3954 - Rhynauerstr. 15 - CH-6002 Luzern
> > Tel. +41 41 317 2020 - Fax +41 41 317 2029
> > Internet http://www.outline.ch
> > 
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
> > For additional commands, email: fop-dev-help@xml.apache.org
> 
> -- 
> 
> David B. Bitton
> david@codenoevil.com
> 
> Diversa ab illis virtute valemus.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-dev-unsubscribe@xml.a
-- 

David B. Bitton
david@codenoevil.com

Diversa ab illis virtute valemus.

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org


Re: Fw: Re: Rendering from a Document

Posted by "David B. Bitton" <da...@codenoevil.com>.
Ok this is what I'm doing:

I produce an XML file from data stored on a mainframe.  The XML is generate in a VB object.  The XML is
passed up to an ASP page that makes a Low Level API SOAP call, using MSSOAP Toolkit 2.0,  to my PDF server.
The PDF server is running Tomcat 4/Apache SOAP 2.2.

On the PDF server, I receive the XML as literalxml in the envelope, fetch a stylesheet, pass the Element
object to a Xalan 2.3 transformer (wrapped in a DOMSource object), and then transform the XML into XSL:FO
objects.  

Now I have a Document object that was returned from the transformer wrapped in a DOMResults object.  The
next step is where the problem lies.  I want to pass the Document to a Driver, but I get the dreaded
NullPointerException.

Most of the time, the XML is will be small ( 5 - 7K), but there is a potention for an account to have 5 to
10 thousand transactions in a day, and we store up to 63 days of data (a single transaction in XML is 594
bytes, therefore a 630K transaction XML file would be 374MB, plus some extra data at the top).  So you can
see what I have the potential to deal with.

What I don't even know is how FOP will handle this.  The XSL:FO file is sure to be much larger than 380MB.
I transformer a 6.66KB XML file and it produced a XSL:FO file of 16.2KB.  If we use that as a benchmark,
than the same 374MB would become 909.8MB.  That's a whole lot of RAM, not to mention what FOP is going to
use to store the rendered PDF.

I'm hoping that someone can poke a hole in these numbers (please), because this is getting to look a whole
lot bigger than expected.  Obviously performance and resource utilization are major concernes (like when are
they not?).  Obviously SAX for this would be faster because it wouldn't require loading the entire XML
contents into memory.

So, now is here the questions come in.  Do I return from the transform a SAXResults?  Also, how do I
effectively handle the incoming XML into the SOAP method?  I would prefer to send the XML in literalxml
format so the < and > are HTML encoded (increasing the size of the content even more).

Where do I go from here?


On Fri, Mar 22, 2002 at 04:49:40PM +0100, Jeremias Maerki wrote:
> <comment>Oops, that one didn't make it to the list at first.</comment>
> 
> DOM (Document) should work. But using DOM to process a 400MB XML? You
> wouldn't want to do that. Try to find a way to use SAX. You can fill SAX
> events into FOP to create the FO tree. Maybe it helps us to provide you
> with some pointers and ideas if you tell us what exactly you're trying
> to do.
> 
> > 	I'm sorry to post this again but I need help.  Does passing a Document datatype to the Driver
> > render() method work?  I have to potential to move XML files in excess of 400MB and so I need to avoid as
> > moving of data in memory as possible.
> 
> Cheers,
> Jeremias M?rki
> 
> mailto:jeremias.maerki@outline.ch
> 
> OUTLINE AG
> Postfach 3954 - Rhynauerstr. 15 - CH-6002 Luzern
> Tel. +41 41 317 2020 - Fax +41 41 317 2029
> Internet http://www.outline.ch
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
> For additional commands, email: fop-dev-help@xml.apache.org

-- 

David B. Bitton
david@codenoevil.com

Diversa ab illis virtute valemus.

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org