XML
The XML editor is for the XML that integration and configuration work runs on - orders and invoices between systems, settings files, feeds. Edit it as text, with colouring, folding and completion, or as a tree, changing values and attributes in place and adding, moving and deleting nodes; and compare it with another version side by side.
Give it the schema and every rule a document breaks is underlined on the element or attribute that breaks it, in plain words, and listed in a problems panel; completion offers what the schema allows at the caret. An XPath bar finds nodes and steps through them; format, minify and Canonical XML are a click away; and an edit made in the tree changes only the characters it must, so the rest of the file keeps its layout.
A purchase order, checked
A made-up stationery order, checked against the buyer's order schema - two schema documents, the shared types imported from the second. Since it was sent on Monday the paper has gone up to eight boxes and a note has been added: the Compare view shows both. Break a rule to see how it is reported, then put it right.
// Node 18 or later, from the Pro or Gold package: check the night's orders before they are sent on.
import { readdirSync, readFileSync } from 'node:fs';
import { compileXmlSchema, checkXml, selectNodes, xpathString } from './dist/node/bmx-xml-editor.mjs';
const schema = compileXmlSchema(['order.xsd', 'common.xsd'].map(location => ({ location, text: readFileSync(`schemas/${location}`, 'utf8') })));
for (const name of readdirSync('outbox')) {
const { valid, problems, document } = checkXml(readFileSync(`outbox/${name}`, 'utf8'), schema);
const total = document ? selectNodes(document, '//o:Total', { namespaces: { o: 'urn:example:order' } }).map(xpathString)[0] : '';
console.log(`${name}: ${valid ? `valid, total ${total}` : problems.map(p => `${p.line}:${p.column} ${p.message}`).join('; ')}`);
}
A service's settings, by tree
A made-up booking service's settings file, opened as a tree with no schema. Change a value in place and only those characters change. The page refuses any edit to the licence, which the deployment owns - try it. Then find the features that are switched off, or write the file in its canonical form for a signature.