commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Pimley <>
Subject [digester] noob failing to pull in raw XML
Date Mon, 13 Sep 2004 14:47:32 GMT

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:

  <entry>(raw XML data)</entry>
  <entry>(even more data)</entry>

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 

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:

View raw message