commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From José Antonio Pérez Testa <>
Subject Re: [digester] noob failing to pull in raw XML
Date Mon, 13 Sep 2004 15:56:35 GMT
You can preprocess your input xml and put in  CDATA tags and pass the 
new xml to Digester!
 <entry><![CDATA[(raw XML data)]]></entry>
 <entry><![CDATA[(even more data)]]</entry>

Peter Pimley wrote:

> Hello everybody.
> I'd like to use digester to parse an XML file.  What makes my 
> situation unusual is that sometimes I want to be able to pull in raw 
> XML withing trying to interpret it.  My documents are of the form:
> <entries>
>  <entry>(raw XML data)</entry>
>  <entry>(even more data)</entry>
>  etc....
> All I know about the raw XML data is that it is gaurenteed -not- to 
> contain an </entry> tag.  Other than that, your guess is as good as 
> mine, as it comes from the users of my system.  It might not even be 
> valid XML.  So, I just want to read it in as completely raw data up 
> until the end tag.
> My first attempt (I've never used digester before) was to add 
> something like:
> digester.addCallMethod ("entries/entry" "doStuff");
> ... but this didn't work.  Typically, the raw XML starts with some 
> start tag of its own, so the <entry> tag has an empty body.  The 
> String passed into "doStuff" has zero length.
> Is there a way to tell digester to ignore all XML tags from a certain 
> node downwards?
> Thanks in advance,
> Peter Pimley, Semantico
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:
Este correo electrónico y, en su caso, cualquier fichero anexo al mismo, contiene información
de carácter confidencial exclusivamente dirigida a su destinatario o destinatarios. Queda
prohibida su divulgación, copia o distribución a terceros sin la previa autorización escrita
de Indra. En el caso de haber recibido este correo electrónico por error, se ruega notificar
inmediatamente esta circunstancia mediante reenvío a la dirección electrónica del remitente.

The information in this e-mail and in any attachments is confidential and solely for the attention
and use of the named addressee(s). You are hereby notified that any dissemination, distribution
or copy of this communication is prohibited without the prior written consent of Indra. If
you have received this communication in error, please, notify the sender by reply e-mail

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message