https://github.com/netascode/xmldot-playground
Interactive browser-based playground for experimenting with XMLDOT queries using WebAssembly. Query XML documents using simple dot-notation paths with real-time results, built-in examples, and comprehensive security controls.
https://github.com/netascode/xmldot-playground
golang xml xml-parser
Last synced: 2 months ago
JSON representation
Interactive browser-based playground for experimenting with XMLDOT queries using WebAssembly. Query XML documents using simple dot-notation paths with real-time results, built-in examples, and comprehensive security controls.
- Host: GitHub
- URL: https://github.com/netascode/xmldot-playground
- Owner: netascode
- License: mit
- Created: 2025-10-16T05:49:36.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2025-11-01T13:13:27.000Z (8 months ago)
- Last Synced: 2026-01-30T12:52:45.165Z (5 months ago)
- Topics: golang, xml, xml-parser
- Language: JavaScript
- Homepage: https://netascode.github.io/xmldot-playground/
- Size: 21.5 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# XMLDOT Playground
An interactive browser-based playground for experimenting with [XMLDOT](https://github.com/netascode/xmldot) XML queries using WebAssembly.
## Live Playground
**[Try it now!](https://netascode.github.io/xmldot-playground/)**
## About
XMLDOT Playground allows you to experiment with XML queries directly in your browser without any installation. It compiles the XMLDOT Go library to WebAssembly, enabling real-time query execution with instant results.
### Features
- **Real-time Query Execution**: Type XML and queries, see results instantly
- **Security Controls**: Resource limits prevent DoS attacks (10MB XML, 4KB queries)
- **Strict Content Security Policy**: No unsafe-inline, SRI hashes for all resources
- **Optimized WASM**: ~845 KB compressed download (2.9MB raw, optimized with -ldflags="-s -w")
- **Comprehensive Error Handling**: Graceful error messages for invalid input
- **No Installation Required**: Runs entirely in your browser
- **Interactive Examples**: Built-in example XML documents and query history
- **Dark Theme**: Easy on the eyes for extended use
## What is XMLDOT?
XMLDOT is a high-performance Go library for querying XML documents using a simple dot-notation path syntax. It provides a fast and intuitive way to extract data from XML documents.
**Example**:
```go
xml := `XML Guide`
title := xmldot.Get(xml, "catalog.book.title").String()
// Result: "XML Guide"
```
Learn more at the [XMLDOT repository](https://github.com/netascode/xmldot).
## Local Development
### Prerequisites
- **Go 1.24 or later** (required for building WASM)
- **Python 3.6+ or Python 2.7** (required for local server)
- **Modern web browser** with WebAssembly support (Chrome, Firefox, Safari, Edge)
### Quick Start
```bash
# Clone the repository
git clone https://github.com/netascode/xmldot-playground.git
cd xmldot-playground
# Build and start local server
make serve
# Open browser to http://localhost:8000
```
### Building
```bash
# Build WASM binary and copy runtime
make build
```
### Makefile Commands
- `make build` - Compile WASM binary and copy Go WASM runtime
- `make serve` - Build and start local HTTP server at http://localhost:8000
- `make verify` - Verify all build artifacts exist with size report
- `make clean` - Remove generated files (xmldot.wasm, wasm_exec.js)
- `make check-prereqs` - Validate prerequisites are installed
- `make deploy` - Show deployment instructions
## License
MIT License - see [LICENSE](LICENSE) file for details.
## Related Projects
- [XMLDOT](https://github.com/netascode/xmldot) - The XML query library powering this playground
- [gjson-play](https://github.com/tidwall/gjson-play) - Inspiration for this project (JSON query playground)
---
Built with Go and WebAssembly