From 786342aeefb62273691c868c40eddade7fd272a1 Mon Sep 17 00:00:00 2001 From: Daniel Birket Date: Sun, 15 Aug 2021 14:38:24 -0400 Subject: [PATCH] xml: draft all but 3 most complex subcommands --- pages/common/xml-canonic.md | 14 +++++++++++++- pages/common/xml-depyx.md | 10 +++++++++- pages/common/xml-edit.md | 22 +++++++++++++++++++++- pages/common/xml-elements.md | 22 +++++++++++++++++++++- pages/common/xml-escape.md | 2 +- pages/common/xml-format.md | 22 +++++++++++++++++++++- pages/common/xml-list.md | 10 +++++++++- pages/common/xml-pyx.md | 10 +++++++++- pages/common/xml-select.md | 22 +++++++++++++++++++++- pages/common/xml-transform.md | 22 +++++++++++++++++++++- pages/common/xml-unescape.md | 4 ++-- pages/common/xml-validate.md | 2 +- pages/common/xml.md | 4 ++-- 13 files changed, 151 insertions(+), 15 deletions(-) diff --git a/pages/common/xml-canonic.md b/pages/common/xml-canonic.md index 496577d4b..7fd7cf2b2 100644 --- a/pages/common/xml-canonic.md +++ b/pages/common/xml-canonic.md @@ -1,8 +1,20 @@ # xml-canonic -> XMLStarlet toolkit: Make XML documents canonical. +> Make XML documents canonical. > More information: . +- Make an XML document canonical, including comments (default): + +`xml canonic --with-comments {{path/to/input.xml|URI}} >{{path/to/output.xml}}` + +- Make an XML document canonical, without comments: + +`xml canonic --without-comments {{path/to/input.xml|URI}} >{{path/to/output.xml}}` + +- Exclusive XML canonicalization, using an XPATH from a file: + +`xml canonic --exc-with-comments {{path/to/input.xml|URI}} {{path/to/c14n.xpath}}` + - Display help for `canonic` subcommand: `xml canonic --help` diff --git a/pages/common/xml-depyx.md b/pages/common/xml-depyx.md index 2659277a6..883617447 100644 --- a/pages/common/xml-depyx.md +++ b/pages/common/xml-depyx.md @@ -1,8 +1,16 @@ # xml-depyx -> XMLStarlet toolkit: Convert a PYX document to XML format. (ESIS - ISO 8879). +> Convert a PYX (ESIS - ISO 8879) document to XML format. > More information: . +- Convert a PYX (ESIS - ISO 8879) document to XML format: + +`xml depyx {{path/to/input.pyx|URI}} >{{path/to/output.xml}}` + +- Convert a PYX document from standard input to XML format: + +`cat {{path/to/input.pyx}} | xml depyx >{{path/to/output.xml}}` + - Display help for `depyx` subcommand: `xml depyx --help` diff --git a/pages/common/xml-edit.md b/pages/common/xml-edit.md index c29804ef3..5507490cf 100644 --- a/pages/common/xml-edit.md +++ b/pages/common/xml-edit.md @@ -1,8 +1,28 @@ # xml-edit -> XMLStarlet toolkit: Edit an XML document. +> Edit an XML document. > More information: . +- TBD: + +`xml edit` + +- TBD: + +`xml edit` + +- TBD: + +`xml edit` + +- TBD: + +`xml edit` + +- TBD: + +`xml edit` + - Display help for `edit` subcommand: `xml edit --help` diff --git a/pages/common/xml-elements.md b/pages/common/xml-elements.md index 9e2a5c704..33272c15d 100644 --- a/pages/common/xml-elements.md +++ b/pages/common/xml-elements.md @@ -1,8 +1,28 @@ # xml-elements -> XMLStarlet toolkit: Diaplay element structure of an XML document. +> Extract elements and structure of an XML document. > More information: . +- Extract elements of an XML document (as XPATH expressions): + +`xml elements {{path/to/input.xml|URI}} >{{path/to/elements}}` + +- Extract elements and attributes of an XML document: + +`xml elements -a {{path/to/input.xml|URI}} >{{path/to/elements}}` + +- Extract elements, attributes, and their values: + +`xml elements -v {{path/to/input.xml|URI}} >{{path/to/elements}}` + +- Print sorted unique elements of an XML document (to see structure): + +`xml elements -u {{path/to/input.xml|URI}}` + +- Print sorted unique elements up to a depth of 3: + +`xml elements -d{{3}} {{path/to/input.xml|URI}}` + - Display help for `elements` subcommand: `xml elements --help` diff --git a/pages/common/xml-escape.md b/pages/common/xml-escape.md index a210aac50..6dcf2ded1 100644 --- a/pages/common/xml-escape.md +++ b/pages/common/xml-escape.md @@ -1,6 +1,6 @@ # xml-escape -> XMLStarlet toolkit: Escape special XML characters. +> Escape special XML characters. > More information: . - Escape special XML characters in a string: diff --git a/pages/common/xml-format.md b/pages/common/xml-format.md index a46ae1c46..f1042cb7f 100644 --- a/pages/common/xml-format.md +++ b/pages/common/xml-format.md @@ -1,8 +1,28 @@ # xml-format -> XMLStarlet toolkit: Format an XML document. +> Format an XML document. > More information: . +- Format an XML document, indenting with tabs: + +`xml format --indent-tab {{path/to/input.xml|URI}} >{{path/to/output.xml}}` + +- Format an HTML document, indenting with 4 spaces: + +`xml format --html --indent-spaces {{4}} {{path/to/input.html|URI}} >{{path/to/output.html}}` + +- Recover parsable parts of a malformed XML document, without indenting: + +`xml format --recover --noindent {{path/to/malformed.xml|URI}} >{{path/to/recovered.xml}}` + +- Format an XML document from standard input, removing the DOCTYPE declaration: + +`cat {{path\to\input.xml}} | xml format --dropdtd >{{path/to/output.xml}}` + +- Format an XML document, omitting the XML declaration: + +`xml format --omit-decl {{path\to\input.xml|URI}} >{{path/to/output.xml}}` + - Display help for `format` subcommand: `xml format --help` diff --git a/pages/common/xml-list.md b/pages/common/xml-list.md index 349da2dd1..ffc6ba6ed 100644 --- a/pages/common/xml-list.md +++ b/pages/common/xml-list.md @@ -1,8 +1,16 @@ # xml-list -> XMLStarlet toolkit: List a directory as XML. +> List a directory as XML. > More information: . +- List the current directory to an XML file: + +`xml list >{{path/to/dir_list.xml}}` + +- List the specified directory to an XML file: + +`xml list {{path/to/directory}} >{{path/to/dir_list.xml}}` + - Display help for `list` subcommand: `xml list --help` diff --git a/pages/common/xml-pyx.md b/pages/common/xml-pyx.md index e5c1a2389..cc704b993 100644 --- a/pages/common/xml-pyx.md +++ b/pages/common/xml-pyx.md @@ -1,8 +1,16 @@ # xml-pyx -> XMLStarlet toolkit: Convert XML documents to PYX format. (ESIS - ISO 8879). +> Convert an XML document to PYX (ESIS - ISO 8879) format. > More information: . +- Convert an XML document to PYX format: + +`xml pyx {{path/to/input.xml|URI}} >{{path/to/output.pyx}}` + +- Convert an XML document from standard input to PYX format: + +`cat {{path/to/input.xml}} | xml pyx >{{path/to/output.pyx}}` + - Display help for `pyx` subcommand: `xml pyx --help` diff --git a/pages/common/xml-select.md b/pages/common/xml-select.md index 0dd2ea101..11b0433b9 100644 --- a/pages/common/xml-select.md +++ b/pages/common/xml-select.md @@ -1,8 +1,28 @@ # xml-select -> XMLStarlet toolkit: Select from XML documents. +> Select from XML documents using XPATH. > More information: . +- TBD: + +`xml select` + +- TBD: + +`xml select` + +- TBD: + +`xml select` + +- TBD: + +`xml select` + +- TBD: + +`xml select` + - Display help for `select` subcommand: `xml select --help` diff --git a/pages/common/xml-transform.md b/pages/common/xml-transform.md index ecb26f6f4..733509fff 100644 --- a/pages/common/xml-transform.md +++ b/pages/common/xml-transform.md @@ -1,8 +1,28 @@ # xml-transform -> XMLStarlet toolkit: Transform XML documents using XSLT. +> Transform XML documents using XSLT. > More information: . +- TBD: + +`xml transform` + +- TBD: + +`xml transform` + +- TBD: + +`xml transform` + +- TBD: + +`xml transform` + +- TBD: + +`xml transform` + - Display help for `transform` subcommand: `xml transform --help` diff --git a/pages/common/xml-unescape.md b/pages/common/xml-unescape.md index 15b72dd91..f11b15ae3 100644 --- a/pages/common/xml-unescape.md +++ b/pages/common/xml-unescape.md @@ -1,6 +1,6 @@ -# xml-edit +# xml-unescape -> XMLStarlet toolkit: Un-escape special XML characters. +> Un-escape special XML characters. > More information: . - Unescape special XML characters from a string: diff --git a/pages/common/xml-validate.md b/pages/common/xml-validate.md index d9201c102..ed9caca3f 100644 --- a/pages/common/xml-validate.md +++ b/pages/common/xml-validate.md @@ -1,6 +1,6 @@ # xml-validate -> XMLStarlet toolkit: Validate XML documents. +> Validate XML documents. > More information: . - Validate XML document for well-formedness only (default): diff --git a/pages/common/xml.md b/pages/common/xml.md index 7f508562d..3ad9ee3cd 100644 --- a/pages/common/xml.md +++ b/pages/common/xml.md @@ -1,7 +1,7 @@ # xml -> XMLStarlet toolkit: Query, edit, check, and transform XML documents. -> Subcommands: `canonic`, `edit`, `elements`, `escape`, `format`, `list`, `pyx`, `p2x`, `select`, `transform`, `unescape`, or `validate`. +> XMLStarlet Toolkit: Query, edit, check, convert and transform XML documents. +> Subcommands: `canonic`, `edit`, `elements`, `escape`, `unescape`, `format`, `list`, `pyx`, `depyx`, `select`, `transform`, or `validate`. > More information: . - Execute a subcommand with input from a file or URI and using standard output: