CmdID

CmdID / Commands

xmlstarlet

An XML/XSLT toolkit. tldr-pages

On several platforms

Opens CmdID with your command. It is read in your browser and sent nowhere.

Several platforms

from tldr-pages, CC BY 4.0

An XML/XSLT toolkit. Note: You will likely need to know XPath: <https://developer.mozilla.org/en-US/docs/Web/XPath>.

Format an XML document and print to stdout

xmlstarlet format path/to/file.xmlIdentify

Format an XML document piped from stdin

cat path/to/file.xml | xmlstarlet formatIdentify

Print all nodes that match a given XPath

xmlstarlet select --template --copy-of xpath path/to/file.xmlIdentify

Insert an attribute to all matching nodes, and print to stdout (source file is unchanged)

xmlstarlet edit --insert xpath --type attr --name attribute_name --value attribute_value path/to/file.xmlIdentify

Update the value of all matching nodes in place (source file is changed)

xmlstarlet edit --inplace --update xpath --value new_value file.xmlIdentify

Delete all matching nodes in place (source file is changed)

xmlstarlet edit --inplace --delete xpath file.xmlIdentify

Escape or unescape special XML characters in a given string

xmlstarlet [un]escape stringIdentify

List a given directory as XML (omit argument to list current directory)

xmlstarlet ls path/to/directoryIdentify