콘텐츠로 이동

Interactive Demo

이 콘텐츠는 아직 번역되지 않았습니다.

Experience the power of stax-xml/converter right in your browser! This interactive demo lets you experiment with different XML parsing scenarios using our declarative, type-safe API.

🚀 Open in Full Screen for the best experience.

Parse XML into structured JavaScript objects with type safety and validation.

Extract arrays of elements from XML documents using XPath selectors.

Apply custom transformation functions to parsed data for data manipulation.

Enforce constraints on your data with built-in validation methods like min(), max(), and int().

Parse real-world RSS feed structures with nested arrays and complex schemas.

Access XML attributes using XPath attribute selectors (@attribute).

Handle complex nested structures with arrays inside objects inside arrays.

Mark fields as optional to handle incomplete or variable XML documents.

  1. Choose an Example: Click one of the quick example buttons to load a pre-configured scenario
  2. Edit the XML: Modify the XML input to test different structures
  3. Adjust the Schema: Change the schema definition to match your XML structure
  4. Select Mode: Choose between Sync (string-based) or Async (ReadableStream-based) parsing
  5. Parse: Click the “Parse XML” button to see the result
  6. Upload Files: Test with your own XML files (up to 10MB)

The demo tracks:

  • Parse Time: How long it took to parse the XML
  • Mode: Whether sync or async parsing was used
  • XML Size: The size of your input XML
  • Throughput: Processing speed in KB/s

Once you’ve experimented with the demo, install stax-xml in your project:

Terminal window
npm install stax-xml

Then use the same patterns from the demo:

import { x } from 'stax-xml/converter';
const schema = x.object({
title: x.string().xpath('/book/title'),
author: x.string().xpath('/book/author'),
price: x.number().xpath('/book/price')
});
const result = schema.parseSync(xmlString);