How to get Xmllint to read from stdin?

I had a similar issue where I had to unzip an XML file then feed it to xmllint. The key is the “-” option which tells xmllint to read from stdin.

For example:

$ bzip2 -dc dierehabilitati00delagoog_meta.xml.bz2 | xmllint --format

would fail giving the “usage” for xmllint. Adding “-” worked:

$ bzip2 -dc dierehabilitati00delagoog_meta.xml.bz2 | xmllint --format -
<?xml version="1.0"?>
<metadata>
  <title>Die Rehabilitation im Strafrecht</title>
  <creator>Ernst Delaquis</creator>
  <mediatype>texts</mediatype>
  <collection>americana</collection>
</metadata>

Hope this helps.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)