You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by Dave Ballard <db...@perenne.com> on 2001/04/14 15:54:27 UTC

transformation question

Hello,

I'm sure this is a naive Xalan J question, but I'll give it a shot. When the
Transformer.transform(Source, StreamResult) method is called, how is the
source XML processed? Is the entire XML document loaded, and then
transformed, or is the XML processed some number of elements at a time, and
the result streamed out incrementally?

Say I'm reading from a database. The model I've got stuck in my head is that
it should be simple for me to interate over my result set and 'push' the
result XML to a transformer as the XML is being generated, say one record at
a time. So, it would be nice if the Transformer (or a Transformer like
class) wrapped an output stream or writer.

>From the API I've seen, I will need to wrap my database record retrieval as
an input stream or reader to be used as a Source. This looks fairly awkward
if the XML generation procedure is complex.

What I'm trying to achieve is a stream, with no buffering of the entire data
set along the transformation (database -> XML (XSL transform) -> result). Is
this achievable?

If the Transformer buffers the XML, then it doesn't matter, and I will do
something simple like writing my result XML to a file before calling
'transform'.

Thanks,
Dave


RE: transformation question

Posted by Dave Ballard <db...@perenne.com>.
Thanks Arnaud,

I'll try the developers list.

Dave

> -----Original Message-----
> From: Arnaud Le Hors [mailto:lehors@us.ibm.com]
> Sent: Thursday, April 19, 2001 9:23 PM
> To: xerces-j-user@xml.apache.org
> Subject: Re: transformation question
> 
> 
> > Hello,
> >  
> > Haven't heard a response -- can anyone recommend a more 
> appropriate list for this post?
> 
> How about the xalan list? Check out http://xml.apache.org/mail.html
> I know there is also a general XSL user list somewhere else but I don't
> know where it is, the xalan people could tell you.
> -- 
> Arnaud  Le Hors - IBM Cupertino, XML Strategy Group
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-j-user-help@xml.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org


Re: transformation question

Posted by Arnaud Le Hors <le...@us.ibm.com>.
> Hello,
>  
> Haven't heard a response -- can anyone recommend a more appropriate list for this post?

How about the xalan list? Check out http://xml.apache.org/mail.html
I know there is also a general XSL user list somewhere else but I don't
know where it is, the xalan people could tell you.
-- 
Arnaud  Le Hors - IBM Cupertino, XML Strategy Group

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org


RE: transformation question

Posted by Dave Ballard <db...@perenne.com>.
Hello,

Haven't heard a response -- can anyone recommend a more appropriate list for
this post?

Thanks,
Dave
    -----Original Message-----
    From: Dave Ballard [mailto:dballard@perenne.com]
    Sent: Saturday, April 14, 2001 8:54 AM
    To: xerces-j-user@xml.apache.org
    Subject: transformation question


    Hello,

    I'm sure this is a naive Xalan J question, but I'll give it a shot. When
the Transformer.transform(Source, StreamResult) method is called, how is the
source XML processed? Is the entire XML document loaded, and then
transformed, or is the XML processed some number of elements at a time, and
the result streamed out incrementally?

    Say I'm reading from a database. The model I've got stuck in my head is
that it should be simple for me to interate over my result set and 'push'
the result XML to a transformer as the XML is being generated, say one
record at a time. So, it would be nice if the Transformer (or a Transformer
like class) wrapped an output stream or writer.

    From the API I've seen, I will need to wrap my database record retrieval
as an input stream or reader to be used as a Source. This looks fairly
awkward if the XML generation procedure is complex.

    What I'm trying to achieve is a stream, with no buffering of the entire
data set along the transformation (database -> XML (XSL transform) ->
result). Is this achievable?

    If the Transformer buffers the XML, then it doesn't matter, and I will
do something simple like writing my result XML to a file before calling
'transform'.

    Thanks,
    Dave