I have an XML file full of bookmarks from Google Bookmarks. (File: http://gist.github.com/324844) I want to pull the bookmark based on this path: xml_api_reply->bookmarks-bookmark->labels->label.
So, my question is How can I use SimpleXML to grab the bookmarks that have the label Inspiration? Some bookmarks may have more than one bookmark.
EDIT: The file listed above is just a sample.
You’ll have to use XPath for that.
The nodes you want:
The filter you want to apply:
Gives you the following XPath query:
Used in a script:
Alternatively, you could also use the shorter
//bookmark[labels/label = "Inspiration"]— see that XPath tutorial