Skip to content

About

A small, browser-based tool for checking XML syntax and validating XML documents against XML Schema (XSD).

Topics

Resources

Code of conduct

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

XML Validator

A small, browser-based tool for checking XML syntax and validating XML documents against XML Schema (XSD).

XML documents and schemas are processed locally in the browser. No document or schema contents are transmitted.

Features

  • XML well-formedness checking and XSD 1.0 validation
  • Support for namespaces, multiple local schemas, imports and includes
  • Paste, open or drag and drop XML and XSD files
  • Automatic character encoding detection and display
  • Support for UTF-8, UTF-16, UTF-32, US-ASCII, ISO-8859-1 and browser-supported legacy encodings
  • Detailed validation diagnostics with source navigation and excerpts
  • Built-in XML and XSD examples
  • Responsive layout with automatic light and dark mode
  • WebAssembly-based schema validation
  • Asynchronous file loading, encoding detection and validation using Web Workers
  • Progress indicators, processing feedback and cancellation
  • Automatic read-only previews for large files with optional full editor access
  • Support for XML files up to 50 MiB and individual XSD files up to 10 MiB
  • Runs entirely locally in the browser

XML encoding detection uses byte order marks, byte signatures and XML declarations as described in XML 1.0 Appendix F. Files without encoding information default to UTF-8. Legacy encoding labels generally follow the WHATWG Encoding Standard, with exact US-ASCII and ISO-8859-1 decoding. Unsupported encodings, conflicting declarations and invalid byte sequences produce errors. EBCDIC and unusual UCS-4 byte orders are not supported. Original encoding declarations remain in the editors; validation snapshots are normalized to UTF-8.

Files larger than 2 MiB (or 2,097,152 decoded UTF-16 code units) are opened as bounded read-only previews by default. The full decoded source is retained in memory and validated, not just the preview. Users may explicitly open the entire file in the editor, which can be slow. Very large clipboard pastes or explicit full-editor rendering can still block the browser briefly. File size limits apply both to original bytes and normalized UTF-8 input; actual validation capacity depends on the XML structure, schema complexity, available browser memory and libxml2 limits. Validation is not streaming and can use up to 512 MiB of WebAssembly memory plus browser memory.

Privacy

All XML parsing and schema validation happens locally in the browser.

The application has no backend, sends no XML documents or schemas over the network, and uses no analytics or external runtime services.

The validation engine is distributed with the application. Schema imports and includes are supported using explicitly supplied local XSD files. Remote schema references and DTD declarations are not supported.

Live version

The tool is deployed using GitHub Pages and can be used directly in a modern web browser.

Live version

Development

The tool is implemented using plain HTML, CSS and JavaScript, without relying on a frontend framework. The source code is organized into ECMAScript modules with JSDoc annotations and strict JavaScript type checking.

XML syntax checking and XML Schema validation use libxml2 compiled to WebAssembly through xmllint-wasm. File reading, decoding, syntax checks, schema-reference checks and XSD validation run in Web Workers. The application owns the libxml2 worker and uses the pinned xmllint-wasm 5.3.0 worker message protocol to support cancellation; review that protocol before updating the dependency.

Vite provides the development server and production build tooling. The WebAssembly validation engine and its associated browser worker and license notice are automatically copied from the installed npm package during development and production builds. No additional backend or runtime infrastructure is required.

The prerequisites are:

Clone the repository and install the dependencies using the committed lockfile to ensure a reproducible installation:

npm ci

Start the local development server with automatic reloading whenever source files change:

npm run dev

The project uses the built-in Node.js test runner without requiring an additional testing framework. The tests cover utility functions, local file handling, diagnostic mapping and XML Schema validation using the actual WebAssembly engine. To run the complete test suite:

npm test

Create an optimized production build:

npm run build

The production build is generated in the dist/ directory and contains all HTML, CSS, JavaScript and WebAssembly assets required to run the application. Relative asset URLs allow deployment to any static web server, including hosting under a subdirectory.

To serve and inspect the production build locally before deployment, run:

npm run preview

Can I help?

Yes, that would be much appreciated. The best way to help is to post a response via the Issue Tracker and/or submit a Pull Request.

About

A small, browser-based tool for checking XML syntax and validating XML documents against XML Schema (XSD).

Topics

Resources

Code of conduct

Stars

0 stars

Watchers

0 watching

Forks

Contributors

Languages