You indicated off-list that you didn't understand my response. This is
probably because I misunderstood your question.
You can pass the transform() method an object that implements the
javax.xml.transform.Source interface. This includes a StreamSource, a
SAXSource, or a DOMSource. The Saxon object DocumentInfo, which
represents an XML document as a Saxon tree, also implements this
interface and can therefore be passed to the transform() method.
If you want to transform a document once only, then it is generally best
to pass it as a StreamSource. But if you want to transform the document
multiple times, the best way is to build the tree once, and pass it to
transform() as a DocumentInfo. If the document has been built in memory
by the application code as a DOM, then pass it as a DOMSource.
I hope this information helps you, but if not, you will have to explain
in more detail the nature of what you are trying to do and the problems
you are having.
> -----Original Message-----
> From: saxon-help-admin@...
> [mailto:saxon-help-admin@...] On Behalf Of
> Michael Kay
> Sent: 02 August 2003 22:28
> To: 'FireNet - Information'; saxon-help@...
> Subject: RE: [saxon] Using Saxon 7.6 in a Java application
> Presumably you want to cache the XML document in memory
> because you are using it as the source of more than one
> The simplest way is to use the method described at:
> The resulting DocumentInfo object implements the JAXP Source
> interface and can therefore be used as input to the
> transform() method.
> This is assuming you are using Saxon 7.x; the procedure for
> 6.5.2 is rather more convoluted, but it can still be done.
> Michael Kay
> > -----Original Message-----
> > From: saxon-help-admin@...
> > [mailto:saxon-help-admin@...] On Behalf Of
> > FireNet - Information
> > Sent: 26 July 2003 06:59
> > To: saxon-help@...
> > Subject: [saxon] Using Saxon 7.6 in a Java application
> > Hey everybody...
> > I have begun learning Java, and it is very interesting.
> > But I have this problem of mine: I have an XML file of more
> > than 100mb, and a rather small stylesheet of a few kb.
> > I've used the SaxonServlet as example, to integrate the
> > transformer into my application. But when I run the
> > transform() routine, it seems that I can only pass a stream.
> > And to my knowledge, a stream is read "on request".
> > I just want to know how I can cache the XML file in the
> > memory...Thanks.
> > - Matias Hansen
> > -------------------------------------------------------
> > This SF.Net email sponsored by: Free pre-built ASP.NET sites
> > including Data Reports, E-commerce, Portals, and Forums are
> > available now. Download today and enter to win an XBOX or
> > Visual Studio .NET.
> > http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet
> saxon-help mailing list
> https://lists.sourceforge.net/lists/listinfo/s> axon-help
> This SF.Net email sponsored by: Free pre-built ASP.NET sites
> including Data Reports, E-commerce, Portals, and Forums are
> available now. Download today and enter to win an XBOX or
> Visual Studio .NET.
saxon-help mailing list