xml: marchersimon requested changes

This commit is contained in:
Daniel Birket
2021-08-23 21:20:17 -04:00
committed by Starbeamrainbowlabs
parent 8815c90985
commit aa67236fc3
6 changed files with 20 additions and 20 deletions

View File

@@ -5,23 +5,23 @@
- Delete elements matching an XPATH from an XML document:
`xml edit --delete {{"XPATH1"}} {{path/to/input.xml|URI}}`
`xml edit --delete "{{XPATH1}}" {{path/to/input.xml|URI}}`
- Move an element node of an XML document from XPATH1 to XPATH2:
`xml edit --move {{"XPATH1"}} {{"XPATH2"}} {{path/to/input.xml|URI}}`
`xml edit --move "{{XPATH1}}" "{{XPATH2}}" {{path/to/input.xml|URI}}`
- Rename all attributes named "id" to "ID":
`xml edit --rename {{"//*/@id"}} -v {{"ID"}} {{path/to/input.xml|URI}}`
`xml edit --rename "{{//*/@id}}" -v "{{ID}}" {{path/to/input.xml|URI}}`
- Rename XML elements of "table" named "rec" to "record":
- Rename the XML elements of "table" named "rec" to "record":
`xml edit --rename {{"/xml/table/rec"}} -v {{"record"}} {{path/to/input.xml|URI}}`
`xml edit --rename "{{/xml/table/rec}}" -v "{{record}}" {{path/to/input.xml|URI}}`
- Update the value of XML table record ID=3 to 5:
- Update the XML table record with "id=3" to the value "id=5":
`xml edit --update {{"xml/table/rec[@id=3]/@id"}} -v {{5}} {{path/to/input.xml|URI}}`
`xml edit --update "{{xml/table/rec[@id=3]/@id}}" -v {{5}} {{path/to/input.xml|URI}}`
- Display help for the `edit` subcommand: