2021-08-16 08:23:55 -04:00
|
|
|
# xml elements
|
2021-08-14 18:17:52 -04:00
|
|
|
|
2021-08-23 21:20:17 -04:00
|
|
|
> Extract elements and display the structure of an XML document.
|
2024-10-12 10:02:00 +02:00
|
|
|
> More information: <https://xmlstar.sourceforge.net/docs.php>.
|
2021-08-14 18:17:52 -04:00
|
|
|
|
2021-08-16 08:23:55 -04:00
|
|
|
- Extract elements from an XML document (producing XPATH expressions):
|
2021-08-15 14:38:24 -04:00
|
|
|
|
2021-08-23 21:20:17 -04:00
|
|
|
`xml elements {{path/to/input.xml|URI}} > {{path/to/elements.xpath}}`
|
2021-08-15 14:38:24 -04:00
|
|
|
|
2021-08-20 21:33:37 -04:00
|
|
|
- Extract elements and their attributes from an XML document:
|
2021-08-15 14:38:24 -04:00
|
|
|
|
2021-08-23 21:20:17 -04:00
|
|
|
`xml elements -a {{path/to/input.xml|URI}} > {{path/to/elements.xpath}}`
|
2021-08-15 14:38:24 -04:00
|
|
|
|
2021-08-20 21:33:37 -04:00
|
|
|
- Extract elements and their attributes and values from an XML document:
|
2021-08-15 14:38:24 -04:00
|
|
|
|
2021-08-23 21:20:17 -04:00
|
|
|
`xml elements -v {{path/to/input.xml|URI}} > {{path/to/elements.xpath}}`
|
2021-08-15 14:38:24 -04:00
|
|
|
|
2021-08-20 21:33:37 -04:00
|
|
|
- Print sorted unique elements from an XML document to see its structure:
|
2021-08-15 14:38:24 -04:00
|
|
|
|
|
|
|
`xml elements -u {{path/to/input.xml|URI}}`
|
|
|
|
|
2021-08-20 21:33:37 -04:00
|
|
|
- Print sorted unique elements from an XML document up to a depth of 3:
|
2021-08-15 14:38:24 -04:00
|
|
|
|
|
|
|
`xml elements -d{{3}} {{path/to/input.xml|URI}}`
|
|
|
|
|
2024-01-30 01:55:24 -03:00
|
|
|
- Display help:
|
2021-08-14 18:17:52 -04:00
|
|
|
|
|
|
|
`xml elements --help`
|