[EMAIL PROTECTED] wrote:

> >My problem: The transformer seems to hold the complete "Tree" in memory
> >before writing anything to the file :-(
>
> So it's definitely something we're interested in, but we're still in the
> early stages of figuring out how to make it work. Until we do, you may find
> that you're still better off hand-coding some kinds of SAX filters.

I think I hav a solution (not tested yet).
What do you think about the following:

Since I know that I want to use the template for "streaming XML" and I know
the "elements" of the stream (or the "separators") I may do the following:

1. Create a simple XML-Filter "StreamXSLTFilter"
2. Give the filter the information what separates "elements"/contains
"elements"
3. Give the filter the XSLT-Template
    3.1 The filter creates a Templateobject of the XSLT-Template

4. The Filter gets pushed and passes information/filters information not
related to elements
      (e.g. the container structure around the list of elements)
    4.1 When the filter encounters an element a new transformer is created
using the temaplate and passed the information
           until the end of the element is reached (just counting open/close
element should be sufficient)
            When the end is reached we continue at point 4.

The questions I have with that:
    1. Is a transformer when used with a template object lightweight enough to
be used that way?
    2. The transformer will need calls to startDocument/endDocument, right?
         So I need a second helper filter after the transformer (when using
SAXResult) to filter them
         out.
    3. When using a StreamResult on a Writer/OutputStream where the
transformer should write
          it's information into:
        3.1 Will the transformer close the Writer/Stream on endDocument()?
        3.2 May I re-use the same StreamResult in the next transformer
instance?

Opinions?

Ciao,
    Carsten Heyl

--
  Carsten Heyl                          [EMAIL PROTECTED]
  Pixelboxx GmbH                        http://www.pixelboxx.de/
  Ostenhellweg 56-58                    Tel.:   +49 231 53 46 30
D-44135 Dortmund                        Mobile: +49 174 31 83 608


Reply via email to