什么是Nokogiri的clojure等价物(使用xpath和css选择器进行xml解析)

时间:2022-12-01 13:02:07

I'm looking for a Clojure equivalent of Nokogiri in Ruby. Specifically, I want to be able to traverse XML using CSS and XPath selectors.

我正在寻找与Ruby中的Nokogiri相当的Clojure。具体来说,我希望能够使用CSS和XPath选择器遍历XML。

1 个解决方案

#1


5  

First a word of caution: currently, no native Clojure lib deals correctly with XML namespaces.

首先要提醒一句:目前,没有本地Clojure lib可以正确处理XML命名空间。

To traverse and transform HTML and XML using CSS-like selectors there's is Enlive (tutorial). The set of predicates supported by Enlive is open so you can easily extend its selectors.

要使用类似CSS的选择器来遍历和转换HTML和XML,那就是Enlive(教程)。 Enlive支持的谓词集是开放的,因此您可以轻松扩展其选择器。

#1


5  

First a word of caution: currently, no native Clojure lib deals correctly with XML namespaces.

首先要提醒一句:目前,没有本地Clojure lib可以正确处理XML命名空间。

To traverse and transform HTML and XML using CSS-like selectors there's is Enlive (tutorial). The set of predicates supported by Enlive is open so you can easily extend its selectors.

要使用类似CSS的选择器来遍历和转换HTML和XML,那就是Enlive(教程)。 Enlive支持的谓词集是开放的,因此您可以轻松扩展其选择器。