我試過使用XPath 2.0
exp //span/string(.)
在libxml2
,但它不起作用。
所以,我的問題是:libxml2
是否支持XPath 2.0
?libxml2是否支持XPath 2.0?
回答
據我所知 - 不是。主流的大多數XPath 2.0實現是XSLT 2.0處理器或XQuery處理器的一部分。
根據來自libxml2維護者的this 2007 email,libxml2不支持,也不會支持XPath 2.0。
您可能會感興趣的an XPath 2.0 extension to libxml2 - 然而,2個地告誡:這是正在進行的工作,它是免費的僅用於非商業用途。
希望這有助於
最好的問候,卡斯滕
PS: 我既不用工作libx中的球員我也沒有使用它或知識之外,從他們的網站信息的任何個人的經驗下屬。
的libxml2實現了許多現有的標準來標記語言相關:
the XML standard: http://www.w3.org/TR/REC-xml Namespaces in XML: http://www.w3.org/TR/REC-xml-names/ XML Base: http://www.w3.org/TR/xmlbase/ RFC 2396 : Uniform Resource Identifiers http://www.ietf.org/rfc/rfc2396.txt XML Path Language (XPath) 1.0: http://www.w3.org/TR/xpath HTML4 parser: http://www.w3.org/TR/html401/ XML Pointer Language (XPointer) Version 1.0: http://www.w3.org/TR/xptr XML Inclusions (XInclude) Version 1.0: http://www.w3.org/TR/xinclude/ ISO-8859-x encodings, as well as rfc2044 [UTF-8] and rfc2781 [UTF-16] Unicode encodings, and more if using iconv support part of SGML Open Technical Resolution TR9401:1997 XML Catalogs Working Draft 06 August 2001: http://www.oasis-open.org/committees/entity/spec-2001-08-06.html Canonical XML Version 1.0: http://www.w3.org/TR/xml-c14n and the Exclusive XML Canonicalization CR draft http://www.w3.org/TR/xml-exc-c14n Relax NG, ISO/IEC 19757-2:2003, http://www.oasis-open.org/committees/relax-ng/spec-20011203.html W3C XML Schemas Part 2: Datatypes REC 02 May 2001 W3C xml:id Working Draft 7 April 2004
因爲libxml2的支持XPath 1.0,語法不正確:
//span/string(.)
應該是:
string(//span/.)
爲了澄清,string
方法也是XPath 1.0的一部分。以供將來參考:
libxml2的支持XPath 1.0
目的-C經由NSXMLNode在GNUstep的/ NextStep自動的
nodesForXPath
方法支持XPath 2.0
可可實施使用XPath 2.0,這是一個萬維網聯盟的建議。
參考
我不認爲這是正確的;至少,[這個答案](http://stackoverflow.com/a/2821094/179332)指出'// span/string(。)'是有效的XPath 2.0。 –
@AdamSpiers我回答了這個問題:'所以,我的問題是:libxml2是否支持XPath 2.0? –
- 1. tinyxpath 1.3.1是否支持xpath 2.0?
- 2. mac 10.3.9是否支持libxml2?
- 3. jsoup是否支持xpath?
- 4. 使Apache Xerces支持Xpath 2.0
- 5. Sitefinity是否支持SAML 2.0?
- 6. tomcat7是否支持SAML 2.0?
- 7. Twitter是否支持OAuth 2.0?
- 8. AppEngine是否支持OAuth 2.0?
- 9. JDK 6是否支持XPath 2.0的所有功能?
- 10. XPath是否支持WHERE子句?
- 11. XPATH 2.0的數據庫支持
- 12. 什麼瀏覽器支持Xpath 2.0?
- 13. Lync Server 2013是否支持UCWA 2.0
- 14. bluemix SSO是否支持Angular 2.0
- 15. Android SDK 2.0是否支持A2DP和AVRCP
- 16. Swagger 2.0是否支持矩陣參數?
- 17. Android x86是否支持OPEN GLES 2.0?
- 18. HTC Magic是否支持OpenGl ES 2.0?
- 19. Play-Slick插件是否支持Slick 2.0?
- 20. Facebook實際上是否支持OAuth 2.0?
- 21. xmllint是否支持xpath 2.0;如果是的話如何使用運營商?
- 22. XPath 2.0表達式的測試用例,它可以測試解析器是否支持XPath 2.0
- 23. NodeJS xpath庫是否支持XPath查詢表達式?
- 24. InDesign CS6是否支持XSLT2?
- 25. Watin支持xPath嗎?
- 26. 是否支持usb 3.0端口支持筆記本電腦的usb 2.0設備
- 27. TinyTDS是否支持Ruby 2.0.0?
- 28. 春天是否支持SharePoint
- 29. 是否支持groovvy
- 30. 是否支持SSI?
環節都死了:)你知道我在哪裏可以下載這個庫? – 2012-11-30 13:16:50