From 3fd2da89bb7667e20f6ee1b45ea53e33d6dd3356 Mon Sep 17 00:00:00 2001 From: Daniel Birket Date: Sat, 14 Aug 2021 21:49:20 -0400 Subject: [PATCH] xml: added escape, unescape, validate subcommands --- pages/common/xml-escape.md | 8 ++++++++ pages/common/xml-unescape.md | 8 ++++++++ pages/common/xml-validate.md | 18 +++++++++++++++++- pages/common/xml.md | 6 +++--- 4 files changed, 36 insertions(+), 4 deletions(-) diff --git a/pages/common/xml-escape.md b/pages/common/xml-escape.md index 36b19f2df2..58808c97bb 100644 --- a/pages/common/xml-escape.md +++ b/pages/common/xml-escape.md @@ -3,6 +3,14 @@ > XMLStarlet toolkit: Escape special XML characters. > More information: . +- Escape special XML characters in a string: + +`xml escape {{""}}` + +- Escape special XML characters in standard input: + +`echo {{""}} | xml escape` + - Display help for `escape` subcommand: `xml escape --help` diff --git a/pages/common/xml-unescape.md b/pages/common/xml-unescape.md index 3d48d89eec..f788eef0fd 100644 --- a/pages/common/xml-unescape.md +++ b/pages/common/xml-unescape.md @@ -3,6 +3,14 @@ > XMLStarlet toolkit: Un-escape special XML characters. > More information: . +- Unescape special XML characters from a string: + +`xml unescape {{"<a1>"}}` + +- Unescape special XML characters from standard input: + +`echo {{"<a1>"}} | xml unescape` + - Display help for `unescape` subcommand: `xml escape --help` diff --git a/pages/common/xml-validate.md b/pages/common/xml-validate.md index a2d3c30130..c947d9816c 100644 --- a/pages/common/xml-validate.md +++ b/pages/common/xml-validate.md @@ -1,7 +1,23 @@ # xml-validate > XMLStarlet toolkit: Validate XML documents. -> More information: . +> More information: . + +- Validate XML document for well-formedness only (default): + +`xml validate --well-formed {{path/to/input1.xml|URI}} {{input2.xml ...}}` + +- Validate XML document against Document Type Definition (DTD): + +`xml validate --dtd {{path/to/schema.dtd}} {{path/to/input1.xml|URI}} {{input2.xml ...}}` + +- Validate XML document against XML Schema Definition (XSD): + +`xml validate --xsd {{path/to/schema.xsd}} {{path/to/input1.xml|URI}} {{input2.xml ...}}` + +- Validate XML document against a Relax NG schema (RNG): + +`xml validate --relaxng {{path/to/schema.rng}} {{path/to/input1.xml|URI}} {{input2.xml ...}}` - Display help for `validate` subcommand: diff --git a/pages/common/xml.md b/pages/common/xml.md index 8c8105420c..499baf3fdd 100644 --- a/pages/common/xml.md +++ b/pages/common/xml.md @@ -2,11 +2,11 @@ > XMLStarlet toolkit: Query, edit, check, and transform XML documents. > Subcommands: `canonic`, `edit`, `elements`, `escape`, `format`, `list`, `pyx`, `p2x`, `select`, `transform`, `unescape`, or `validate`. -> More information: . +> More information: . - Execute a subcommand with input from a file or URI and using standard output: -`xml {{subcommand}} {{options}} {{xml_file_or_uri}}` +`xml {{subcommand}} {{options}} {{path/to/input.xml|URI}}` - Execute a subcommand using standard input and standard output: @@ -14,7 +14,7 @@ - Execute a subcommand with input from a file or URI and output to a file: -`xml {{subcommand}} {{options}} {{xml_file_or_uri}} >{{path/to/output}}` +`xml {{subcommand}} {{options}} {{path/to/input.xml|URI}} >{{path/to/output}}` - Display help for a subcommand: