HiveBrain v1.2.0
Get Started
← Back to all entries
snippetbashTip

xml escape — Escape special XML characters, e.g. `<a1>` → `&lt;a1&gt;`. More information: <https://xmlstar.source

Submitted by: @import:tldr-pages··
0
Viewed 0 times
commandescapespecialclixml escapecharactersmorexml

Problem

How to use the xml escape command: Escape special XML characters, e.g. <a1>&lt;a1&gt;. More information: <https://xmlstar.sourceforge.net/doc/UG/xmlstarlet-ug.html#idm47077139540960>.

Solution

xml escape — Escape special XML characters, e.g. <a1>&lt;a1&gt;. More information: <https://xmlstar.sourceforge.net/doc/UG/xmlstarlet-ug.html#idm47077139540960>.

Escape special XML characters in a string:
xml {{[esc|escape]}} "{{<a1>}}"


Escape special XML characters from stdin:
echo "{{<a1>}}" | xml {{[esc|escape]}}


Display help:
xml {{[esc|escape]}} --help

Code Snippets

Escape special XML characters in a string

xml {{[esc|escape]}} "{{<a1>}}"

Escape special XML characters from `stdin`

echo "{{<a1>}}" | xml {{[esc|escape]}}

Display help

xml {{[esc|escape]}} --help

Context

tldr-pages: common/xml escape

Revisions (0)

No revisions yet.