尝试使用id=bk112筛选帐簿失败。我用的是cygwin最新最棒的。有没有人能让它工作起来?
文件: /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>02 xpath属性id="bk112“但未找到任何内容
$ xpath /tmp/myLOG/xpath-filter/book.xml catalog/book[@id="bk112"]
No nodes found发布于 2015-12-18 02:49:47
也许就像这样?
catalog/book[contains(., "bk112")]https://stackoverflow.com/questions/34286424
复制相似问题