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