How are XML attributes represented in the parsed tree?
Attributes are prefixed with "@" in the JSON output. So <book id="bk101" available="true"> becomes { "@id": "bk101", "@available": "true" }. This is the same convention used by xml2js, fast-xml-parser, and most JSON-XML bridges, which keeps the output round-trippable and avoids name collisions between attributes and child elements.
What about namespaces?
Namespace prefixes are kept on the qualified element name — <dc:title> appears in the parsed tree as "dc:title". Namespace declarations (xmlns:dc="...") show up as @-prefix attributes on the element where they're declared. The DOMParser used under the hood is XML-namespace-aware, so prefix resolution follows the W3C spec.
How does the parser handle CDATA?
CDATA sections are unwrapped — the parser reads their content as text and surfaces it as a #text value on the parent element. So <description><![CDATA[<em>bold</em>]]></description> parses as { "description": "<em>bold</em>" }. The literal characters inside CDATA are preserved exactly, which matters for HTML fragments embedded in XML.
What's the difference between this parser and the XML validator?
The validator confirms a document is well-formed and stops — it answers "yes/no, valid?". The parser goes further: it returns the parsed structure (tree, JSON, attribute map) so you can inspect or consume it. Use the validator when you only need the verdict; use the parser when you also want to see the shape of the data.
Mixed content with text and child elements — what happens?
When an element contains both text and children (e.g. <p>Hello <b>world</b>!</p>), the parser stores the text under "#text" and the child elements under their tag names. You may lose the original interleaved order in the JSON form — for round-trip fidelity, work with the XML tree directly rather than the JSON projection.
Can it parse documents over the network?
No — the parser only handles XML you paste into the input panel. It does not fetch URLs, follow xinclude references, or expand external entity declarations. That last one is intentional: external entity expansion is the basis of XXE attacks, which the browser DOMParser blocks by default.
Are repeated elements grouped into arrays?
Yes. When the parser encounters two or more siblings with the same tag name (e.g. multiple <book> children), it collects them into a JSON array. A single occurrence stays as an object — same heuristic xml2js and fast-xml-parser use. If you need consistent array behaviour for downstream code, post-process the result.
Does the parser send my XML anywhere?
No. The browser's native DOMParser handles everything client-side. No HTTP request fires when you click Parse — verifiable via the DevTools Network tab. That matters when the document contains customer data, API tokens, internal endpoint URLs, or any payload that cannot leave your network.