xml: add select, edit and transform subcommands.
This commit is contained in:

committed by
Starbeamrainbowlabs

parent
82f626c693
commit
1202e84d48
@@ -1,27 +1,24 @@
|
||||
# xml select
|
||||
|
||||
> Select from XML documents using XPATH.
|
||||
> More information: <http://xmlstar.sourceforge.net/doc/xmlstarlet.pdft>.
|
||||
> Select from XML documents using XPATHs.
|
||||
> Tip: use `xml elements` to display the XPATHs of an XML document.
|
||||
> More information: <http://xmlstar.sourceforge.net/docs.php>.
|
||||
|
||||
- TBD:
|
||||
- Select all elements matching "XPATH1" and print the value of the element "XPATH2":
|
||||
|
||||
`xml select`
|
||||
`xml select --template --match {{"XPATH1"}} --value-of {{"XPATH2"}} {{path/to/input.xml|URI}}`
|
||||
|
||||
- TBD:
|
||||
- Match "XPATH1" and print the value of "XPATH2" as text with new-lines:
|
||||
|
||||
`xml select`
|
||||
`xml select --text --template --match {{"XPATH1"}} --value-of {{"XPATH2"}} --nl {{path/to/input.xml|URI}}`
|
||||
|
||||
- TBD:
|
||||
- Count the elements of "XPATH1":
|
||||
|
||||
`xml select`
|
||||
`xml select --template --value-of "count({{XPATH1}})" {{path/to/input.xml|URI}}`
|
||||
|
||||
- TBD:
|
||||
- Count all nodes in XML document(s):
|
||||
|
||||
`xml select`
|
||||
|
||||
- TBD:
|
||||
|
||||
`xml select`
|
||||
`xml select --text --template --inp-name --output " " --value-of "count(node())" --nl {{path/to/input1.xml|URI}} {{path/to/input2.xml|URI}}`
|
||||
|
||||
- Display help for the `select` subcommand:
|
||||
|
||||
|
Reference in New Issue
Block a user