I am trying to validate metadata.xml against www.gentoo.org/dtd/metadata.dtd with xmllint from =dev-libs/libxml2-2.9.3 ebuild.
I tried the commands (some from here):
$ xmllint --noout --valid metadata.xml
error : Unknown IO error
metadata.xml:2: warning: failed to load external entity "http://www.gentoo.org/dtd/metadata.dtd"
the same for xmllint metadata.xml --dtdvalid metadata.dtd
and xmllint --loaddtd http://www.gentoo.org/dtd/metadata.dtd
$ xmllint --valid metadata.xml --schema metadata.dtd
metadata.dtd:1: parser error : StartTag: invalid element name
I need xmllint and not mono-xmltool (from C#/CLI) because xmllint is used in repoman -d
command. And repoman is used for gentoo overlay validation in travis-ci
How to validate xml with xmllint properly?
UPD: site returns "HTTP/1.1 301 Moved Permanently" and that is why load fails
part of strace:
recvfrom(3, "HTTP/1.1 301 Moved Permanently\r\n"..., 4096, 0, NULL, NULL) = 446
recvfrom(3, "", 4096, 0, NULL, NULL) = 0
close(3) = 0
write(2, "error : ", 8error : ) = 8
write(2, "Unknown IO error\n", 17Unknown IO error
probably libxml2 doesn't do https
USE="icu ipv6 python readline -debug -examples -lzma -static-libs {-test}"
libxml2 uses nanoHTTP, nanoHTTP can work with HTTPS