的libxml的xmlNodePtr原始XML字符串? [英] libxml xmlNodePtr to raw xml string?

查看:114
本文介绍了的libxml的xmlNodePtr原始XML字符串?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

给定一个有效的,任意的xmlNodePtr,我想重新串节点的presentation,包括标签,属性和孩子在相同的形式(递归)。

Given a valid, arbitrary xmlNodePtr, I would like the string representation of that node, including the tag, attributes, and children in the same form (recursive).

FWIW,我的情况是我使用PerformXPathQuery从现有的文件中获取数据块。我需要查询的,这嵌套在它的XML元素,作为原始字符串的结果,这样我就可以将其插入一个文本字段。

FWIW, my scenario is I am using PerformXPathQuery to get a block of data from within an existing document. I need to get the results of the query, which has nested XML elements in it, as the raw string, so I can insert it into a text field.

这似乎是一个简单的任务,但是我无法找到一个简单的方法。写一个xmlDocPtr到文件必须做到这一点,但是,我看不到一个方便的方法,将做同样的事情在树的任意节点,并在内存中返回。

These seems like a simple task, however I cannot find an easy way. Writing an xmlDocPtr to file must do this, however, I cannot see a handy method that will do the same thing to an arbitrary node in the tree, and return it in memory.

我希望我只想从棕色的棕色文件的配色方案在盲xmlsoft.org

I hope I am just going blind from the brown-on-brown documentation color scheme at xmlsoft.org

推荐答案

xmlNodeDump (或 xmlNodeDumpOutput )你在寻找什么?

Is xmlNodeDump (or xmlNodeDumpOutput) what you are looking for?

这篇关于的libxml的xmlNodePtr原始XML字符串?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆