cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Torsten Curdt" <tcu...@dff.st>
Subject RE: DOMStreamer
Date Mon, 23 Jul 2001 22:20:50 GMT
> > 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: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Mime
View raw message