Skip to content
jc-rs
GitHub

Private XML to JSON converter

XML to JSON Converter and Viewer

jc-rs maps an XML document to JSON that you can inspect, copy, or pass into a shell pipeline. Its jc/xmltodict-style conventions keep attributes and mixed text distinct from child elements.

xml--xmlv1.0.0

Universalfile

Try the real parser

Paste input on the left. The same Rust parser that ships in the binary runs locally in this page and writes its JSON on the right.

browser · WebAssembly
Loading the local parser.
inputeditable
jc-rs --xmlJSON
Use the Left and Right arrow keys to highlight the matching value in the input.
{
  "catalog": {
    "book": [
      {
        "@id": "b1",
        "title": "Rust in Practice"
      },
      {
        "@id": "b2",
        "title": "Shell Pipelines"
      }
    ]
  }
}

Hover over a JSON value, or focus the JSON pane and use the Left and Right arrow keys, to trace it to the input. Parsing runs inside this tab in WebAssembly. Pasted text and opened files are not uploaded. If site analytics is enabled, it may receive page-level visit data such as the URL, title, and referrer; text in this editor is never included.

Accepted input

One non-empty XML document as UTF-8 text. Elements, attributes, entity references in text, CDATA, comments, and an XML declaration are accepted. Processing instructions and document-type events are skipped, and namespace prefixes are not retained because element and attribute local names are used.

What the JSON contains

  • Attributes use @name keys, while text mixed with attributes or children uses #text.
  • A text-only element becomes a JSON string; an empty element without attributes becomes null.
  • Repeated sibling elements become arrays, while a single child stays a single value.
  • Comments use #comment; surrounding text is trimmed, and separate text parts are joined with a space.

What you can do here

  • Convert XML to JSON without uploading the document
  • Use the XML viewer to inspect attributes and repeated elements as JSON
  • See how the XML parser keeps comments and empty elements visible

Use the same parser in a shell

$ cat document.xml | jc-rs --xml

The browser tool is for inspection. The CLI form is the useful one in scripts, pipes, containers, and repeatable checks.

Continue with the parsed JSON

Fixture coverage

4/4oracle-valid pairs match under the published structural JSON comparison

Magic syntax

not availableThis parser reads a file or a string rather than a command, so there is nothing for jc-rs to run. Pipe it in.

Source: crates/jc-rs-parsers/src/format/xml.rs. jc-rs targets the schemas defined by the original Python tool. Fixture coverage above is the measured evidence for this parser; test the inputs your pipeline depends on. Compare