oxml
🌐 EN , Change language

Documentation

oxml-wasm — WebAssembly XML Engine

A safe, modern alternative to browser DOMParser with zero memory leaks and identical API ergonomics.

Installation

Install via npm or yarn:

npm install @oxml/wasm

JavaScript Usage

Use oxml-wasm in Node.js or browser ES modules:

import { Document } from '@oxml/wasm';

const xml = `
  <catalog>
    <name>Widget</name>19.99</price></product>
    <name>Gadget</name>29.99</price></product>
  </catalog>
`;

const doc = Document.parse(xml);
const results = doc.select("//product[price < 25]/name");
console.log(results[0].textContent); // Widget

Memory Benefits

Unlike the native browser DOMParser, which leaves cyclic references in the garbage collector and consumes unbounded memory on long-lived pages, oxml-wasm operates on a deterministic linear memory buffer with explicit, instant deallocation.