mirror of
https://github.com/ivuorinen/cheatsheet-tldr.git
synced 2026-03-06 08:58:31 +00:00
Update cheatsheets
This commit is contained in:
@@ -6,28 +6,28 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
# xml elements
|
||||
|
||||
> Extract elements and display the structure of an XML document.
|
||||
> More information: <https://xmlstar.sourceforge.net/docs.php>.
|
||||
> More information: <https://xmlstar.sourceforge.net/doc/UG/xmlstarlet-ug.html#idm47077139665568>.
|
||||
|
||||
- Extract elements from an XML document (producing XPATH expressions):
|
||||
|
||||
`xml elements {{path/to/input.xml|URI}} > {{path/to/elements.xpath}}`
|
||||
`xml {{[el|elements]}} {{path/to/input.xml|URI}} > {{path/to/elements.xpath}}`
|
||||
|
||||
- Extract elements and their attributes from an XML document:
|
||||
|
||||
`xml elements -a {{path/to/input.xml|URI}} > {{path/to/elements.xpath}}`
|
||||
`xml {{[el|elements]}} -a {{path/to/input.xml|URI}} > {{path/to/elements.xpath}}`
|
||||
|
||||
- Extract elements and their attributes and values from an XML document:
|
||||
|
||||
`xml elements -v {{path/to/input.xml|URI}} > {{path/to/elements.xpath}}`
|
||||
`xml {{[el|elements]}} -v {{path/to/input.xml|URI}} > {{path/to/elements.xpath}}`
|
||||
|
||||
- Print sorted unique elements from an XML document to see its structure:
|
||||
|
||||
`xml elements -u {{path/to/input.xml|URI}}`
|
||||
`xml {{[el|elements]}} -u {{path/to/input.xml|URI}}`
|
||||
|
||||
- Print sorted unique elements from an XML document up to a depth of 3:
|
||||
|
||||
`xml elements -d{{3}} {{path/to/input.xml|URI}}`
|
||||
`xml {{[el|elements]}} -d{{3}} {{path/to/input.xml|URI}}`
|
||||
|
||||
- Display help:
|
||||
|
||||
`xml elements --help`
|
||||
`xml {{[el|elements]}} --help`
|
||||
|
||||
Reference in New Issue
Block a user