$ gem install xpather
$ irb -rxpather
>> XML = File.read("/test/books.xml")
>> document = XPather.new(XML)
=> #<XPather:0x007f9bd2a32030>
>>
>> document.get("/bookstore/book[1]/author")
=> "Giada De Laurentiis"
>>
>> document.get("/bookstore/book/author")
=> ["Giada De Laurentiis", "J K. Rowling", "James McGovern", "Per Bothner", "Kurt Cagle", "James Linn", "Vaidyanathan Nagarajan", "Erik T. Ray"]
>>
>> document.search("/bookstore/book[1]/author")
=> ["<author>Giada De Laurentiis</author>"]
>>
>> document.search("/bookstore/book/author")
=> ["<author>Giada De Laurentiis</author>", "<author>J K. Rowling</author>", "<author>James McGovern</author>", "<author>Per Bothner</author>", "<author>Kurt Cagle</author>", "<author>James Linn</author>", "<author>Vaidyanathan Nagarajan</author>", "<author>Erik T. Ray</author>"]
forked from abedra/xpather
-
Notifications
You must be signed in to change notification settings - Fork 0
jenniferalons/xpather
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
No description, website, or topics provided.
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published
Languages
- Ruby 53.8%
- C 46.2%