Two cases:
1. your "raw data" could be a complete XML doc.
2. your "raw data" will never be an XML doc,
only a well-formed XML element tree.
In the first case, the solution is to wrap
your "raw xml" in a CDATA section, then
digester rules will just treat it as body text.
>From what you describe, chances are you should be
doing that anyways so xml processing declarations
don't cause you problems.
In the second case the solution is to write the
patterns for your rules such that you'll never
bother acting on a particular subtree. You'll
still parse it, just not process any rules.
--- Peter Pimley <[EMAIL PROTECTED]> 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]
>
>
__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - 100MB free storage!
http://promotions.yahoo.com/new_mail
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]