开发者

Retrieving a node original string

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜