python_xml_editor is a local browser-based XML prompt editor with a tiny Python launcher.
It is designed for editing prompt documents that contain:
- a free-form preamble, such as a Markdown heading or note
- an XML body that can be edited visually instead of by hand
The app runs entirely locally. Python serves the static files, and the browser handles parsing, editing, preview, and export.
- open
.md,.txt, and.xmlfiles - edit a prompt preamble separately from the XML structure
- rename tags and edit attributes inline
- add root, child, and sibling elements
- reorder nodes with buttons or drag-and-drop
- edit text nodes directly
- escape XML special characters on export
- support common XML-style attribute names such as
data-idandxml:lang - preview raw XML output
- export either AI-ready XML text or full editor format
XML_Editor.py: local launcher that serves the app and opens the browserindex.html: single HTML mount pointapp.js: main application logic, parsing, tree editing, rendering, and exportstyle.css: application stylingCONTRIBUTING.md: contribution workflow and expectationsdocs/ARCHITECTURE.md: architecture and state model notes
- Python 3.10 or newer is recommended
- no third-party Python dependencies are required
From the repository root:
python XML_Editor.pyIf your machine uses the Windows launcher instead of python, you can also use:
py XML_Editor.pyThe launcher will:
- find a free local port
- serve the repository directory over HTTP
- open
index.htmlin your default browser
Stop the server with Ctrl+C.
- branch from
main - make and test your changes locally
- open a pull request with a clear summary
- include screenshots for UI changes when useful
This repository includes:
- a pull request template in
.github/pull_request_template.md - issue templates for bugs and feature requests
- a basic GitHub Actions workflow for pull requests and pushes
The application has two parts:
- a Python wrapper in
XML_Editor.pythat starts a local HTTP server - a plain JavaScript single-page app in
app.jsthat parses mixed preamble + XML text into a tree, renders it visually, and serializes it back out for export
The editor keeps all state in memory in the browser session and does not currently save automatically.
More detail is available in docs/ARCHITECTURE.md.
- the XML parsing logic is custom and currently optimized for simple prompt-style XML
- export escapes text and attribute values so characters like
&,<, and"remain valid XML - the app is intentionally lightweight and has no front-end framework or backend service