Skip to content

Documentation / @sw-file-lib/xml / escapeXmlAttribute

Function: escapeXmlAttribute() ​

ts
function escapeXmlAttribute(value: string): string;

Defined in: packages/xml/src/writer/index.ts:198

Escape special characters in a string for use in XML attribute values.

The characters &, <, >, and " are replaced with their corresponding XML entities.

Parameters ​

ParameterTypeDescription
valuestringThe string to escape.

Returns ​

string

The escaped string.