2021-08-16 08:23:55 -04:00
|
|
|
# xml canonic
|
2021-08-14 18:17:52 -04:00
|
|
|
|
2021-08-15 14:38:24 -04:00
|
|
|
> Make XML documents canonical.
|
2025-05-11 21:14:19 +03:00
|
|
|
> More information: <https://xmlstar.sourceforge.net/doc/UG/xmlstarlet-ug.html#idm47077139560880>.
|
2021-08-14 18:17:52 -04:00
|
|
|
|
2021-08-20 21:33:37 -04:00
|
|
|
- Make an XML document canonical, preserving comments:
|
2021-08-15 14:38:24 -04:00
|
|
|
|
2025-05-11 21:14:19 +03:00
|
|
|
`xml {{[c14n|canonic]}} {{path/to/input.xml|URI}} > {{path/to/output.xml}}`
|
2021-08-15 14:38:24 -04:00
|
|
|
|
2021-08-16 08:23:55 -04:00
|
|
|
- Make an XML document canonical, removing comments:
|
2021-08-15 14:38:24 -04:00
|
|
|
|
2025-05-11 21:14:19 +03:00
|
|
|
`xml {{[c14n|canonic]}} --without-comments {{path/to/input.xml|URI}} > {{path/to/output.xml}}`
|
2021-08-15 14:38:24 -04:00
|
|
|
|
2021-08-20 21:33:37 -04:00
|
|
|
- Make XML exclusively canonical, using an XPATH from a file, preserving comments:
|
2021-08-15 14:38:24 -04:00
|
|
|
|
2025-05-11 21:14:19 +03:00
|
|
|
`xml {{[c14n|canonic]}} --exc-with-comments {{path/to/input.xml|URI}} {{path/to/c14n.xpath}}`
|
2021-08-15 14:38:24 -04:00
|
|
|
|
2024-01-30 01:55:24 -03:00
|
|
|
- Display help:
|
2021-08-14 18:17:52 -04:00
|
|
|
|
2025-05-11 21:14:19 +03:00
|
|
|
`xml {{[c14n|canonic]}} --help`
|