[xml] parsing output from xmlNodeDump()



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 ...?>
<root>
   <secret-stuff>
      <secret-xml>I'm gonna get encrypted!</secret-xml>
   </secret-stuff>
</root>

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

<?xml ...?>
<root>
   <secret-stuff>
      &lt;secret-xml&gt;ENCRYPTED_TEXT&lt;/secret-xml&gt;
   </secret-stuff>
</root>

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.

Thanks in advance!

- Cory Virok



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