Escape '<' in XML (in text nodes): correct rules and fast fixes

TL;DR: Validate locally, fix the first real error, validate again (no upload).

Fix Escape '<' in XML (in text nodes): correct rules and fast fixes with an XML escape-first workflow and local validation (no upload).

XML escape matrix

CharacterEscapeWhere it matters most
&&amp;Text nodes, attributes, URLs inside XML
<&lt;Text nodes
>&gt;Optional in text; safer in generated markup
"&quot;Attribute values
'&apos;Attribute values

Primary rule for this page

< -> &lt;

Focus for this query

  • Escape reserved XML characters in text/attributes.
  • Keep one well-formed root and validate after each change.
  • Fix the first parser error before touching downstream nodes.

CDATA vs escaping

Use escaping for normal text/attributes. Use CDATA when large literal blocks are easier to keep unchanged.

  • Escaping is safest for machine-generated XML fields.
  • CDATA is convenient for long snippets, but still requires clean XML structure.
  • Never include raw ]]> inside CDATA without splitting/escaping.

Example

<!-- Text node -->
<title>Tom &amp; Jerry</title>

<!-- Attribute value -->
<link href="/search?q=a&amp;b=1" />

<!-- CDATA for rich text -->
<snippet><![CDATA[if (a < b && b > 0) { return a; }]]></snippet>

Fast fix workflow

  1. Find first parser error line/column.
  2. Replace reserved character/entity usage at that location.
  3. Re-validate immediately after each edit.
  4. Convert/export only when parser reports clean XML.

Common parser signals

FAQ

Is anything uploaded to a server? No. All processing happens locally in your browser. Files are never uploaded.

What is the recommended workflow? Validate the input, fix the first real issue, validate again, then export/convert. This avoids compounding errors.

Privacy & Security
All processing happens locally in your browser. Files are never uploaded.

Next pages to check

Closest crawled pages without impressions yet. Added to speed first-impression conversion.

neighbor csharp csharp newtonsoft additional text after finished reading json content p neighbor csharp csharp stj could not be converted system double createdat workflows webhneighbor csharp csharp stj could not be converted system int32 items 0 id checklists ananeighbor csharp csharp stj could not be converted system int32 items 0 id checklists edgneighbor csharp csharp stj could not be converted system int32 items 0 id workflows enteneighbor csharp csharp stj could not be converted system int32 user id checklists analytneighbor csharp go json cannot unmarshal bool into field user id type int troubleshootinneighbor csharp csharp newtonsoft error converting 123 45 system decimal items 0 id trouneighbor csharp csharp newtonsoft error converting 123 45 system guid items 0 id workfloneighbor csharp csharp newtonsoft error converting 123 45 system guid items 0 id workfloneighbor csharp csharp newtonsoft error converting 123 system decimal items 0 id workfloneighbor csharp csharp newtonsoft error converting 123 system guid user id runbooks analneighbor csharp csharp newtonsoft error converting 123 system guid user id workflows ananeighbor csharp csharp newtonsoft error converting 123 system guid user id workflows apineighbor csharp csharp newtonsoft error converting 123 system guid user id workflows webneighbor csharp csharp newtonsoft error converting 123 system int32 user id workflows apneighbor csharp csharp newtonsoft error converting 123 system int32 user id workflows daneighbor csharp csharp newtonsoft error converting 123 system int32 user id workflows we

Quick fix checklist

  • Reproduce the error on a minimal input.
  • Check type/format and field mapping.
  • Apply the smallest safe fix.
  • Validate on production-like payload.