> > I have a DocumentFragment supposebly looking
> > like this:
> >
> > <one>
> > <two/>
> > </one>
> >
> > Now I try to create SAX events from it:
> >
> > DOMStreamer streamer = new DOMStreamer(handler);
> > streamer.stream(fragment);
> >
> > Unfortunately this is also fireing the following
> > events:
> >
> > [setDocumentLocator]
> > [startDocument]
> > [endDocument]
> >
> > Why is that so? Anyone a clue?
>
> I've created an EmbeddedXMLPipe that removes the events you mention. I
> use it like this:
>
> public void toSAX(ContentHandler handler)
> throws SAXException
> {
> try {
> EmbeddedXMLPipe newHandler = new EmbeddedXMLPipe();
> newHandler.setContentHandler(handler);
> parser.setContentHandler(newHandler);
> InputSource source = getInputSource();
> parser.parse(source);
> catch (IOException ex) {
> throw new SAXException(ex);
> }
> }
>
> I have this class in src/org/apache/cocoon/xml/.
Thanks, mate!
Just implemented a wrapper. Will be needed anyway
for the xform backend mapping. So I can use also
to filter out the undesired events.
Thanks anyway!
Hope you are doing well!
--
Torsten
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]