尝试过滤id = bk112的图书失败。 我正在使用cygwin最新和最好的。 让任何人得到这个工作吗?
file:/tmp/myLOG/xpath-filter/book.xml
01 xpath show all the 02 books in XML file
------------------------------------------
$ xpath /tmp/myLOG/xpath-filter/book.xml catalog/book
Found 2 nodes:
-- NODE --
<book id="bk111">
<author>O'Brien, Tim</author>
<title>MSXML3: A Comprehensive Guide</title>
<genre>Computer</genre>
<price>36.95</price>
<publish_date>2000-12-01</publish_date>
<description>The Microsoft MSXML3 parser is covered in
detail, with attention to XML DOM interfaces, XSLT processing,
SAX and more.</description>
</book>
-- NODE --
<book id="bk112">
<author>Galos, Mike</author>
<title>Visual Studio 7: A Comprehensive Guide</title>
<genre>Computer</genre>
<price>49.95</price>
<publish_date>2001-04-16</publish_date>
<description>Microsoft Visual Studio 7 is explored in depth,
looking at how Visual Basic, Visual C++, C#, and ASP+ are
integrated into a comprehensive development
environment.</description>
</book>
$ xpath /tmp/myLOG/xpath-filter/book.xml catalog/book[@id="bk112"]
No nodes found
答案 0 :(得分:0)
也许这样吗?
catalog/book[contains(., "bk112")]