cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jan Harms" <jan.ha...@vivai.de>
Subject AW: Not handle the XML header in the sax parser
Date Thu, 06 Feb 2003 17:03:24 GMT
Well, that´s basically what the IncludeXMLConsumer (in package org.apache.cocoon.xml) does,
doesn´t it? 
It additionally ignores the startDTD() and endDTD() methods.

Regards,

-Jan

> -----Ursprüngliche Nachricht-----
> Von: Heiko Milke [mailto:heiko.milke@cosmoblonde.de]
> Gesendet: Donnerstag, 6. Februar 2003 17:34
> An: cocoon-users@xml.apache.org
> Betreff: Re: Not handle the XML header in the sax parser
> 
> 
> Hey there,
> 
> well actually i dont recommend doing that but here is a way to do it.
> 
> You simple write yourself a documenthandler transmitter or 
> whatever you
> call it (i named it FragmentHandler in the Example):P
> 
> --------------------------
> public class FragmentHandler implements ContentHandler {
>     
>     ContentHandler parent = null;
>     public FragmentHandler(ContentHandler parent) {
>         this.parent = parent;
>     }
> }
> --------------------------
> 
> 
> you have to implement ALL memberfunction of the 
> ContentHandler interface
> and send all the events to the parent like this.
> 
> --------------------------
> public void characters(char[] ch, int start, int length) throws
> SAXException {
> 	parent.characters( ch,  start,  length);
> }
> --------------------------
> 
> and in the last step you simply catch the startDocument and 
> endDocument
> events and dont tell the parent ....
> 
<snip> 

---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <cocoon-users-unsubscribe@xml.apache.org>
For additional commands, e-mail:   <cocoon-users-help@xml.apache.org>


Mime
View raw message