On Mon, 2006-01-23 at 16:24 +0100, Nikolay Georgiev wrote:
> Hello,
> 
> can I make the Digester to parse an XML element that contains random
> data(characters, say HTML code) from it's beginning to it's end and then
> save the data in a string.
> 
> For example:
> 
> <section>
>       <text>
>               I want to save this text with these tags <b>as a String 
> Object</b>. <br />
>       </text>
> </section>
> 
> Is it possible?

Digester takes its input from an XML parser, and there is no way to tell
an XML parser to "stop treating the input as xml for a while" - except
by wrapping the input in CDATA.

If your input was:
 <text>
<![CDATA[
  ....<b>...</b>...<br/>
]]>
 </text>

then everything would work as you want. This is the correct way to
represent arbitrary text embedded within an xml document.

If the content is valid XML, then you could use NodeCreateRule to turn
the content of the <text> element into a dom tree, then walk that tree
to turn it back into text.

Regards,

Simon


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to