Hi guys,
I have the need to parse partial XML fragments (which are presented as std::string), such as this one:
<FOO:node>val</FOO:node>
as xmlDoc
objects in libxml2, and because these are fragments, I keep getting the namespace error : Namespace prefix FOO on node is not defined
errors spit out into STDERR.
What I am looking for is for either a way to filter just these namespace warnings out or parse the XML fragment straight into a xmlNode
object.
I think some sort of hacking around with initGenericErrorDefaultFunc() may be in order to go the first way, but the documentation for libxml2 is absolutely atrocious.
I would frankly prefer to go with the 2nd approach because it would require no error hacking and the node would be already aware of the namespace, but I don't think it's possible because the node has to have a root and XML fragments are not guaranteed to have only one root.
I just need some guidance here of how to rid myself of the namespace error warning.
Thank you very much.