Return-Path: Delivered-To: apmail-xml-cocoon-dev-archive@xml.apache.org Received: (qmail 82425 invoked by uid 500); 24 Jul 2001 17:36:51 -0000 Mailing-List: contact cocoon-dev-help@xml.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Reply-To: cocoon-dev@xml.apache.org Delivered-To: mailing list cocoon-dev@xml.apache.org Received: (qmail 82408 invoked from network); 24 Jul 2001 17:36:50 -0000 Message-Id: <200107241734.KAA09101@hercules.home> X-Mailer: exmh 2.3.1 01/18/2001 with XEmacs 21.1.14 on Linux 2.2.18 From: Ovidiu Predescu To: Davanum Srinivas Cc: cocoon-dev@xml.apache.org Subject: Re: DOMStreamer In-Reply-To: Your message of "Tue, 24 Jul 2001 03:43:44 PDT." <20010724104344.67659.qmail@web12803.mail.yahoo.com> X-Url: http://www.geocities.com/SiliconValley/Monitor/7464/ X-Image-Url: http://www.geocities.com/SiliconValley/Monitor/7464/ovidiu.tiff X-Face: ?(@Y~qjBA}~8ZMh5gM4{Q{bE_*:sCJ3@Z?{B*Co=J!#8bb~-z?-0._vJjt~MM59!MjxG%>U 5>MW^2-\7~z04buszR^=m^U|m66>FdR@cFwhb;.A(8*D.QmLkK]z,md0'HiOE\pyeiv_PACR+P:Cm. wq_%l':E:q]g-UCc>r&s@BVo'kFN;(\9PF22Myg5w%nUBWQ6MJJ#qL#w>2oxckP'H:\$9F"mxsz]Dg k{1`fTcP'Y$CgGnc^paTV$dzhVX+;(U$;Eb)P<>G)g) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Tue, 24 Jul 2001 10:34:39 -0700 Sender: ovidiu@cup.hp.com X-Spam-Rating: h31.sny.collab.net 1.6.2 0/1000/N Dims, On Tue, 24 Jul 2001 03:43:44 -0700 (PDT), Davanum Srinivas wrote: > Ovidiu, > > What does this file have? What format is it in? > > Thanks, > dims > > --- Ovidiu Predescu wrote: > > > > ATTACHMENT part 1 application/octet-stream > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org > > For additional commands, email: cocoon-dev-help@xml.apache.org Somehow it looks like the mailing list software used by cocoon-dev (ezmlm) doesn't like emails with attachments sent by my mailer (a home brewed combination of exmh and emacs on Linux). I apologize for these inconveniences, I'll try to figure out what's wrong. Here is the message again, with the attachments inline: Regards, -- Ovidiu Predescu http://orion.nsr.hp.com/ (inside HP's firewall only) http://sourceforge.net/users/ovidiu/ (my SourceForge page) http://www.geocities.com/SiliconValley/Monitor/7464/ (GNU, Emacs, other stuff) On Mon, 23 Jul 2001 23:45:08 +0200, "Torsten Curdt" wrote: > I have a DocumentFragment supposebly looking > like this: > > > > > > 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/. /* EmbeddedXMLPipe.java Author: Ovidiu Predescu Date: July 11, 2001 */ package org.apache.cocoon.xml; import org.xml.sax.SAXException; /** * This class implements a ContentHandler for embedding a full SAX * event stream into an existing stream of SAX events. An instance of * this class will pass unmodified all the SAX events to the linked * ContentHandler, but will ignore the startDocument and endDocument * events. * * @author Ovidiu Predescu */ public class EmbeddedXMLPipe extends AbstractXMLPipe { /** * Ignore the startDocument event: this method does nothing. * * @exception SAXException if an error occurs */ public void startDocument() throws SAXException { } /** * Ignore the endDocument event: this method does nothing. * * @exception SAXException if an error occurs */ public void endDocument() throws SAXException { } } --------------------------------------------------------------------- To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org For additional commands, email: cocoon-dev-help@xml.apache.org