===========
rss/channel/item
THIS rss/channel/item/title
THIS rss/channel/item/guid
rss/channel/item/guid/@isPermaLink
rss/channel/item/description
rss/channel/item/content:encoded
THIS rss/channel/item/pubDate
rss/channel/item/enclosure
THIS rss/channel/item/enclosure/@url
===========
Would someone have code handy I could use?
Thank you.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
I assume it can be done with XmlStarlet but it requires XPath kung-fu way above my head.
I need to grab an RSS feed using wget, and then feed it to XmlStarlet to grab a few sibings from each item:
wget -qO - https://feeds.acme.com/feed/rss.xml |xmlstarlet\xml.exe sel -t <magic here=""></magic>
===========
rss/channel/item
THIS rss/channel/item/title
THIS rss/channel/item/guid
rss/channel/item/guid/@isPermaLink
rss/channel/item/description
rss/channel/item/content:encoded
THIS rss/channel/item/pubDate
rss/channel/item/enclosure
THIS rss/channel/item/enclosure/@url
===========
Would someone have code handy I could use?
Thank you.
For others' benefit…
After diving into Andrew Watt's "XPath Essentials" from 2002, seasoned with a bit of googling, here's the solution:
xml.exe sel -B -t -m "//item" -v "title" -n -v "guid" -n -v "enclosure/@url" -n -n test.xml