2009/6/24 Daniel Kulp <[email protected]>: > For SAXSource and StreamSource, a "CachedOutputStream" is created and wrapped > with an XMLStreamWriter and the XML stuff is copied from the XMLStreamReader > into the writer and then a StreamSource or SAXSource is created from that > stream. This is semi-low memory as the CachedOutputStream will cache in files > on disk if it gets too large. However, it ends up parsing all the XML to > copy it (and fix namespaces) and then passed as a stream to the app which, in > general, then parses the XML again. Thus, it may have performance impact.
Okay, thanks for the info. > If the Provider is marked just "Source" or "DOMSource", then it parses into a > DOM and returns a DOMSource. This allows you to work with the DOM without > reparsing. However, that's probably more memory intensive. The Provider<Source> is new in 2.2 right? This actually allowed me to simplify some of my code, for a service that requires parsed input but can produce streamed output very quickly. Thanks :-) > One thing I keep meaning to try getting to work is to allow > Provider<XMLStreamReader> to get the raw XMLStreamReader that we use. That > would provide the best performing and best memory usage scenario. It's just > not working yet. That would be awesome. What are the major stumbling blocks? I'm tempted to have a go myself, although if it's giving you serious trouble, I'm not sure how much help I could be... Andrew. -- :: http://biotext.org.uk/ ::
