From 0d9a445e2fac4052e3f6da14917731dbfd3d1527 Mon Sep 17 00:00:00 2001 From: haydenbetts Date: Fri, 14 Jul 2017 01:36:12 -0700 Subject: [PATCH] xmllint: add page (#1425) --- pages/common/xmllint.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 pages/common/xmllint.md diff --git a/pages/common/xmllint.md b/pages/common/xmllint.md new file mode 100644 index 000000000..ad943e2b4 --- /dev/null +++ b/pages/common/xmllint.md @@ -0,0 +1,27 @@ +# xmllint + +> XML parser and linter. + +- Return all nodes named "foo": + +`xmllint --xpath "//{{foo}}" {{source_file.xml}}` + +- Return as string the contents of first node named "foo": + +`xmllint --xpath "string//{{foo}}" {{source_file.xml}}` + +- Use other xpath (a syntax for navigating xml trees) expressions for more options in navigating xml tree: + +`xmllint --xpath "{{xpath_expression}}" {{source_file.xml}}` + +- Return human-readable (indented) xml from file: + +`xmllint --format {{source_file.xml}}` + +- Check that XML meets requirements of its built-in doctype. This is the part starting with ``: + +`xmllint --valid {{source_file.xml}}` + +- Validate XML against DTD schema hosted online: + +`xmllint --dtdvalid {{URL}} {{source_file.xml}}`