Created
September 19, 2017 16:47
-
-
Save garethrees/601627e842cea90152ab59b09d089480 to your computer and use it in GitHub Desktop.
Validate an atom feed from the command line
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Save the Atom RELAX NG Compact Schema locally | |
| # https://xml2rfc.tools.ietf.org/public/rfc/html/rfc4287.html#schema | |
| # Just pasted in to `atom.rnc` | |
| # Save the feed output locally | |
| wget -O request_events.atom "https://www.whatdotheyknow.com/api/v2/body/71/request_events.atom?k=REDACTED&since_date=2017-09-15" | |
| # Install a tool to convert comtact syntax to XML syntax | |
| # Via https://stackoverflow.com/a/45979608/387558 | |
| brew install jing-trang | |
| # Convert the compact syntax to XML syntax | |
| $ trang -I rnc -O rng atom.rnc atom.rng | |
| # Validate the feed | |
| $ xmllint --noout --relaxng atom.rng request_events.atom | |
| request_events.atom validates |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment