Конвертируйте XML в JSON формат
Tool guide
The reverse errand: a supplier feed, a catalogue export or a SOAP response arrives as XML, but the work happens in JavaScript or a Python script. Paste the document into the XML Input box, press the convert button, and you get a structure where tag names have become keys and a run of identically named siblings has collapsed into an array. Parsing is done by the page itself, so a supplier's price list never leaves the machine. See also: run the conversion the other way, back to XML, indent an unreadable XML file first, export the parsed nodes to a table.
Without an attached schema every XML value is text: 8900 says nothing about being numeric. The parse does not guess types and carries the content across as a string, which is the safe choice for SKUs with leading zeros and phone numbers. Cast the fields you need in code, where you know what each tag means.
The parsing here is lightweight and concentrates on node nesting and text content. Check your own document to see whether attributes survived into the output. If they carry meaningful data and the JSON lacks them, process the file with a full parser on the backend, or rewrite the attributes as child elements before converting.
The colon stays part of the tag name, so you get a key spelled "soap:Body" in the JSON, reachable through bracket notation rather than dot notation. If the prefixes get in the way, strip them with find and replace before converting — safe when you are only reading a feed, not when a request signature depends on them.
XML has no separate marker for a list, so a single-item list looks exactly like an ordinary child element. A feed with one item yields an object and a feed with two yields an array, which is why code that always expects an array breaks on the first short file. Check the node type as you walk it, or coerce it to an array.
Your tab's memory sets the limit, not a server quota. Small documents parse instantly, while a multi-megabyte price list can freeze the page because the whole tree is built in memory. For big exports paste a fragment — a couple of product entries — to learn the structure, then process the full file with a script.
The document did not parse, and the page says so outright instead of handing back an empty box or half a structure. The message comes from the browser's own parser and usually names the line. The usual culprits are an unclosed tag, two root elements side by side, raw & or < characters inside text, or a file truncated when it was copied. Fix the spot it names and try again.
Before: A-1 Desk chair 8900
After: { "offer": { "id": "A-1", "name": "Desk chair", "price": "8900" } } Before: sale new
After: { "tags": { "tag": ["sale", "new"] } } Your rating and feedback help decide what to improve next.