Re: [xml] parsing output from xmlNodeDump()

On Wed, Sep 08, 2004 at 04:52:18PM -0400, Cory Virok wrote:
Hello all.

Is there a built in way to parse text that contains entity refs for XML 
markup without manually search-and-replacing entities? I need to reparse 
text that has been output by xmlNodeDump().

In my xml document I am storing xml subtrees as encrypted text within 
XML text nodes. My original XML doc looks like this:

<?xml ...?>
      <secret-xml>I'm gonna get encrypted!</secret-xml>

after encrypting the secret-xml content and making the secret-xml 
subtree a text node via xmlNodeDump() I get something like this:

<?xml ...?>

Now my question is... is there a built in way to parse the text node so 
that the entity refs are automagically recognized as XML markup?
I realize I can just do the search and replace myself... but I'd like to 
use libXML to do this if I can.

  Seems to me you're mostly making the mistake of dumping <secret-xml>
itself and it subtree instead of dumping its *content* in the first place.
There is now (recently added) xmlParseInNodeContext() which I think
does what you want, but again it's needed only because you xmlNodeDump()
the wrong node !


Daniel Veillard      | Red Hat Desktop team
veillard redhat com  | libxml GNOME XML XSLT toolkit | Rpmfind RPM search engine

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]