org.w3c.dom.Document中为String javax.xml.transform中没有 [英] org.w3c.dom.Document to String without javax.xml.transform

查看:194
本文介绍了org.w3c.dom.Document中为String javax.xml.transform中没有的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我花了一段时间四处寻找在谷歌的方式来一个org.w3c.dom.Document中转换为字符串再整个DOM树的presentation,这样我就可以保存对象的文件系统。

I've spent a while looking around on Google for a way to convert a org.w3c.dom.Document to a string representation of the whole DOM tree, so I can save the object to file system.

但所有解决方案,我发现这是不支持作为了Android 2.1 API的一部分javax.xml.transform.Transformer中使用。我怎样才能做到这一点不使用这个类/包包含?

However all the solutions I've found use javax.xml.transform.Transformer which isn't supported as part of the Android 2.1 API. How can I do this without using this class/containing package?

推荐答案

要避免使用变压器您应该手动在你的XML树遍历,否则你可以依靠一些外部库。你应该看看这里

To avoid using Transformer you should manually iterate over your xml tree, otherwise you can rely on some external libraries. You should take a look here.

这篇关于org.w3c.dom.Document中为String javax.xml.transform中没有的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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