In relatively new 20.04.1 installation, xmllint will not read files
Is this a bug, or something I am doing wrong? Or both?
The `xmllint` command (of libxml2 fame) will not open any local files. The `xmlstarlet` command also will usually not open files, I presume because it is relying on libxml2 to open and parse them, but I do not know that.
Here is a shell console listing to demonstrate the problem.
$ #
$ # version of system and xmllint itself
$ #
$ cat /etc/os-release
| NAME="Ubuntu"
| VERSION="20.04.1 LTS (Focal Fossa)"
| ID=ubuntu
| ID_LIKE=debian
| PRETTY_NAME="Ubuntu 20.04.1 LTS"
| VERSION_ID="20.04"
| HOME_URL="https:/
| SUPPORT_URL="https:/
| BUG_REPORT_URL="https:/
| PRIVACY_
| VERSION_
| UBUNTU_
$ which xmllint
| /snap/bin/xmllint
$ xmllint --version
| /snap/libxml2/
| compiled with: Threads Tree Output Push Reader Patterns Writer SAXv1 FTP HTTP DTDValid HTML Legacy C14N Catalog XPath XPointer XInclude Iconv ISO8859X Unicode Regexps Automata Expr Schemas Schematron Modules Debug Zlib Lzma
$ #
$ # input document
$ #
$ cat /tmp/tiny_duck.xml
| <?xml version="1.0" encoding="UTF-8"?>
| <duck>
| <sound>
| </duck>
|
$ #
$ # try it (it fails)
$ #
$ xmllint --format /tmp/tiny_duck.xml
| I/O error : Permission denied
| I/O error : Permission denied
| warning: failed to load external entity "/tmp/tiny_
$ #
$ # Could it actually be a permissions problem?
$ # No, I just `cat`ted that file. But double-check,
$ # anyway.
$ #
$ ls -l /tmp/tiny_duck.xml
| -rw-rw-r-- 1 syd syd 78 Jan 6 08:27 /tmp/tiny_duck.xml
$ whoami
| syd
$ #
$ # try a different command that reads and parses XML on same file
$ #
$ which xmlwf
| /usr/bin/xmlwf
$ xmlwf -v
| xmlwf using expat_2.2.9
| sizeof(XML_Char)=1, sizeof(
$ xmlwf -s -m -d /tmp/ERASE.ME/ /tmp/tiny_duck.xml
$ cat /tmp/ERASE.
| <document>
| <starttag name="duck" uri="/tmp/
| <chars str=" " uri="/tmp/
| <chars str=" " uri="/tmp/
| <starttag name="sound" uri="/tmp/
| <chars str="quack" uri="/tmp/
| <endtag name="sound" uri="/tmp/
| <chars str=" " uri="/tmp/
| <endtag name="duck" uri="/tmp/
| </document>
$
Help *greatly* appreciated, for although I am sure I can live without `xmllint` and `xmlstarlet`, I cannot get any work done without them. I will be forced to revert to 16.04 (or some other earlier release; or some other flavor of GNU/Linux).
Thank you.
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- Ubuntu libxml2 Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- Syd Bauman
- Solved:
- Last query:
- Last reply: