You can preprocess your input xml and put in CDATA tags and pass the new xml to Digester!
<entries>
<entry><![CDATA[(raw XML data)]]></entry>
<entry><![CDATA[(even more data)]]</entry>
etc....


Regards.
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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

-------------------------------------------------------------------------------------------------------------------
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to