iOS - XML Pretty Print [英] iOS - XML Pretty Print

查看:135
本文介绍了iOS - XML Pretty Print的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的iOS应用程序中使用GDataXML并想要一种简单的方法来格式化和打印XML字符串 - 漂亮的打印

I am using GDataXML in my iOS application and want a simple way to format and print an XML string - "pretty print"

有没有人知道一个算法目标C,或者我可以翻译的另一种语言?

Does anyone know of an algorithm in Objective C, or one that works in another language I can translate?

推荐答案

我使用过HTML Tidy(http:// tidy.sourceforge.net/)这样的事情。它是一个C库,因此只要您对C语言感到满意就可以很容易地链接到Objective C运行时和从Objective C运行时调用.C ++ API可以从Objective C ++调用,因此如果您习惯使用它可能更容易使用Objective C ++。

I've used HTML Tidy (http://tidy.sourceforge.net/) for things like this. It's a C library so can be linked in to and called from an Objective C runtime fairly easily as long as you're comfortable with C. The C++ API is callable from Objective C++ so that might be easier to use if you're comfortable with Objective C++.

我没有使用C或C ++绑定;我是通过Ruby或Python完成的,但它们都是相同的lib。它将读取直接XML(以及可能脏的HTML),并且它具有简单和漂亮的打印选项。

I've not used the C or C++ bindings; I did it via Ruby or Python but it's all the same lib. It will read straight XML (as well as potentially dirty HTML) and it has both simple and pretty print options.

这篇关于iOS - XML Pretty Print的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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