13/05/04 01:05:30.54
URLリンク(code.google.com)
// Parse the document from a file
Document document = $(xmlFile).document();
// Wrap the document with the jOOX API
Match x1 = $(document);
// This will get all books (wrapped <book/> DOM Elements)
Match x2 = $(document).find("book");
// This will get all even or odd books
Match x3 = $(document).find("book").filter(even());
Match x4 = $(document).find("book").filter(odd());
// This will get all book ID's
List<String> ids = $(document).find("book").ids();
// This will get all books with ID = 1 or ID = 2
Match x5 = $(document).find("book").filter(ids(1, 2));
// Or, use css-selector syntax:
Match x6 = $(document).find("book#1, book#2");
// This will use XPath to find books with ID = 1 or ID = 2
Match x7 = $(document).xpath("//book[@id = 1 or @id = 2]");