commands.sh

xml edit

all

Edit an XML document.

More info →

Options (7)

boolean

Delete elements matching an XPATH from an XML document

Example: xml {{[ed|edit]}} {{[-d|--delete]}} "{{XPATH1}}" {{path/to/input.xml|URI}}
-d, --deleteboolean

Delete elements matching an XPATH from an XML document

Example: xml {{[ed|edit]}} {{[-d|--delete]}} "{{XPATH1}}" {{path/to/input.xml|URI}}
-m, --moveboolean

Move an element node of an XML document from XPATH1 to XPATH2

Example: xml {{[ed|edit]}} {{[-m|--move]}} "{{XPATH1}}" "{{XPATH2}}" {{path/to/input.xml|URI}}
-r, --renameboolean

Rename all attributes named "id" to "ID"

Example: xml {{[ed|edit]}} {{[-r|--rename]}} "{{//*/@id}}" -v "{{ID}}" {{path/to/input.xml|URI}}
-u, --updateboolean

Update the XML table record with "id=3" to the value "id=5"

Example: xml {{[ed|edit]}} {{[-u|--update]}} "{{xml/table/rec[@id=3]/@id}}" {{[-v|--value]}} {{5}} {{path/to/input.xml|URI}}
-v, --valueboolean

Update the XML table record with "id=3" to the value "id=5"

Example: xml {{[ed|edit]}} {{[-u|--update]}} "{{xml/table/rec[@id=3]/@id}}" {{[-v|--value]}} {{5}} {{path/to/input.xml|URI}}
-h, --helpboolean

Display help

Example: xml {{[ed|edit]}} {{[-h|--help]}}

Examples (6)

Delete elements matching an XPATH from an XML document

xml [ed|edit] [-d|--delete] "XPATH1" path/to/input.xml|URI

Move an element node of an XML document from XPATH1 to XPATH2

xml [ed|edit] [-m|--move] "XPATH1" "XPATH2" path/to/input.xml|URI

Rename all attributes named "id" to "ID"

xml [ed|edit] [-r|--rename] "//*/@id" -v "ID" path/to/input.xml|URI

Rename sub-elements of the element "table" that are named "rec" to "record"

xml [ed|edit] [-r|--rename] "/xml/table/rec" -v "record" path/to/input.xml|URI

Update the XML table record with "id=3" to the value "id=5"

xml [ed|edit] [-u|--update] "xml/table/rec[@id=3]/@id" [-v|--value] 5 path/to/input.xml|URI

Display help

xml [ed|edit] [-h|--help]
made by @shridhargupta | data from tldr-pages