2021-08-16 08:23:55 -04:00
|
|
|
# xml escape
|
2021-08-14 18:17:52 -04:00
|
|
|
|
2021-08-23 21:26:03 -04:00
|
|
|
> Escape special XML characters, e.g. `<a1>` → `<a1>`.
|
2024-10-12 10:02:00 +02:00
|
|
|
> More information: <https://xmlstar.sourceforge.net/doc/xmlstarlet.pdf>.
|
2021-08-14 18:17:52 -04:00
|
|
|
|
2021-08-14 21:49:20 -04:00
|
|
|
- Escape special XML characters in a string:
|
|
|
|
|
2021-08-16 08:23:55 -04:00
|
|
|
`xml escape "{{<a1>}}"`
|
2021-08-14 21:49:20 -04:00
|
|
|
|
2022-12-04 08:53:34 +01:00
|
|
|
- Escape special XML characters from `stdin`:
|
2021-08-14 21:49:20 -04:00
|
|
|
|
2023-06-14 17:32:31 +02:00
|
|
|
`echo "{{<a1>}}" | xml escape`
|
2021-08-14 21:49:20 -04:00
|
|
|
|
2024-01-30 01:55:24 -03:00
|
|
|
- Display help:
|
2021-08-14 18:17:52 -04:00
|
|
|
|
|
|
|
`xml escape --help`
|