Files
cheatsheet-tldr/tldr/xml-escape
2024-10-13 00:18:36 +00:00

22 lines
432 B
Plaintext

---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# xml escape
> Escape special XML characters, e.g. `<a1>` → `&lt;a1&gt;`.
> More information: <https://xmlstar.sourceforge.net/doc/xmlstarlet.pdf>.
- Escape special XML characters in a string:
`xml escape "{{<a1>}}"`
- Escape special XML characters from `stdin`:
`echo "{{<a1>}}" | xml escape`
- Display help:
`xml escape --help`