回答

0

據我所知 - 不是。主流的大多數XPath 2.0實現是XSLT 2.0處理器或XQuery處理器的一部分。

11

根據來自libxml2維護者的this 2007 email,libxml2不支持,也不會支持XPath 2.0。

0

您可能會感興趣的an XPath 2.0 extension to libxml2 - 然而,2個地告誡:這是正在進行的工作,它是免費的僅用於非商業用途。

希望這有助於

最好的問候,卡斯滕

PS: 我既不用工作libx中的球員我也沒有使用它或知識之外,從他們的網站信息的任何個人的經驗下屬。

+0

環節都死了:)你知道我在哪裏可以下載這個庫? – 2012-11-30 13:16:50

0

的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,這是一個萬維網聯盟的建議。

參考

+0

我不認爲這是正確的;至少,[這個答案](http://stackoverflow.com/a/2821094/179332)指出'// span/string(。)'是有效的XPath 2.0。 –

+0

@AdamSpiers我回答了這個問題:'所以,我的問題是:libxml2是否支持XPath 2.0? –