2025-03-14 21:59:59 -06:00
|
|
|
# xml escape
|
|
|
|
|
|
|
|
|
|
> Escape special XML characters, e.g. `<a1>` → `<a1>`.
|
2025-06-28 19:25:29 -06:00
|
|
|
> More information: <https://xmlstar.sourceforge.net/doc/UG/xmlstarlet-ug.html#idm47077139540960>.
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- Escape special XML characters in a string:
|
|
|
|
|
|
2025-06-28 19:25:29 -06:00
|
|
|
`xml {{[esc|escape]}} "{{<a1>}}"`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- Escape special XML characters from `stdin`:
|
|
|
|
|
|
2025-06-28 19:25:29 -06:00
|
|
|
`echo "{{<a1>}}" | xml {{[esc|escape]}}`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- Display help:
|
|
|
|
|
|
2025-06-28 19:25:29 -06:00
|
|
|
`xml {{[esc|escape]}} --help`
|