I'm a newbie with xml/libxml. What I'm trying to do is simple.
I have a node like :
<tag attr="example" attr2="example2"/>
which is stored in a 开发者_如何转开发xmlNode. I want to get the following xmlChar* :
"<tag attr="example" attr2="example2"/>"
I tried xmlNodeGetContent and xmlNodeListGetString but none of them seem to do what I want.
I'm using libxml2 in C. The file xml version is 1.0
xmlNodeGetContent
isn't what you're looking for : check this page for info on its behavior.
I think the function you're looking for is xmlNodeDump
, which will of course require a valid buffer.
精彩评论