读取DOMDocument并使用CSS选择器查找元素 [英] Reading DOMDocument and find elements using CSS selectors

查看:68
本文介绍了读取DOMDocument并使用CSS选择器查找元素的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须将一个android应用程序转换为iOS,此应用程序广泛使用 jsoup 库和

I must convert an android app to iOS, this app uses deeply the jsoup library and the element.select(cssQuery) to find elements starting from CSS selectors.

最初,我想将选择器转换为XPATH并使用xmllib2,但css-selector的使用却非常普遍(数十个配置文件,已经存在的存储文件)

Initially I wanted to convert selectors to XPATH and use xmllib2 but the css-selector usage is really pervasive (dozen of configuration files, already existing stored files)

是否存在一些可以创建HTML文档并使用CSS选择器进行搜索的Cocoa代码/库/框架?

Does exist some Cocoa code/library/framework able to create an HTML document and search using CSS selectors?

推荐答案

我不知道在Cocoa中是否存在使用CSS选择器进行搜索的现有方法,但是我这里是有关iOS上最常见的XML解析器的文章:

I dont know if there is existing method to search using css selectors in Cocoa, but i here is an article about most common xml parsers for iOS:

http://www.raywenderlich.com/553/xml-tutorial-for-ios-how-to-choose-the-best-xml-parser-for-your-iphone-project

就个人而言,我建议使用KissXML.是支持XPath查询的DOM.

Personally, i would recomend KissXML. It's DOM with support for XPath queries.

这篇关于读取DOMDocument并使用CSS选择器查找元素的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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