Christopher Oliver wrote: > Why not have processPipelineTo take a javax.xml.transform.Result > instead of an OutputStream?
Yes, that might be a good solution (although back incompatible IIUC). Buffering in a byte array might also work. I'm just (overly?) worried about the performance penalty of serialization/parsing which does not take place with Sylvain's approach. I think I'm seeking for the best of both, which might only be possible with an extra FOM method?. Guido > > Guido Casper wrote: > >> Did anyone else also feel the need to have something like >> processPipelineTo but getting a DOM or just an InputStream instead of >> just streaming it directly to another OutputStream? >> >> Guido >> >> >> Geoff Howard wrote: >> >> >>> Upayavira wrote: >>> >>> >>>> Maybe my last question was too specific. >>>> >>>> I'm trying to parse the contents of a source into a DOM in >>>> Flowscript, but am getting all sorts of errors. Can anyone provide >>>> a better way than this (which doesn't work)? >>>> >>>> var resolver = >>>> >>>> >>>> >> cocoon.getComponent(Packages.org.apache.excalibur.source.SourceResolver. >> ROLE); >> >> >>>> var source = resolver.resolveURI("blah.xml"); >>>> var builder = >>>> >>>> >>>> >> Packages.javax.xml.parsers.DocumentBuilderFactory.newInstance().newDocum >> entBuilder(); >> >> >>> I think I have observed that you cannot use the returned result of a >>> java method call ( newInstance() ) as a java object in flow ( >>> .newDocumentBuilder() ). >>> >>> The workaround I have found is to separate the calls: >>> >>> var builderFactory = >>> Packages.javax.xml.parsers.DocumentBuilderFactory.newInstance(); >>> >>> var builder = builderFactory.newDocumentBuilder(); >>> >>> I don't know if this is a bug or not, don't know if it's only when >>> calling with Packages or not. I also have not carefully confirmed >>> this. >>> >>> Finally, don't we have a convenience component to do this? >>> >>> Geoff >>> >>> >>> -------------------------------------------------------------------- - >>> To unsubscribe, e-mail: [EMAIL PROTECTED] >>> For additional commands, e-mail: [EMAIL PROTECTED]