Well-formed XML
Simple invoice XML for formatting, validation, and scalar XPath samples.
XPath 2.0+ Planning
Dedicated page for XML, XPath expressions, and namespace mapping. The XPath 2.0+ execution engine has been compared already, and the public UI and sample cases are being finalized first.
XPath input
The page is designed to show node sequences and scalar values clearly.
Namespace support
Prefix lines are used to handle default namespaces and multi-prefix XML.
Current status
This patch publishes the UI and spike result first, then enables the runtime next.
XPath execution is the next step
This patch ships xml-formatter first. xpath-tester currently publishes the UI, fixed sample cases, and engine-comparison result. Actual XPath 2.0+ execution will be enabled in the next integration step.
Need to clean up the XML first?
If formatting or validation comes first, open XML Formatter / Validator
XPath 2.0+ execution is not enabled yet
This page currently publishes the input UI, fixed sample cases, namespace format, and result-layout design first. Runtime execution will appear here once the engine is integrated.
Selected candidate
SaxonJS is the primary choice after the comparison.
Planned v1 scope
Use these cases for attributes, multiple matches, string, number, boolean, and namespace-aware queries.
These four XML samples stay fixed for the spike and acceptance checks.
Well-formed XML
Simple invoice XML for formatting, validation, and scalar XPath samples.
Broken XML
Mismatched closing tag to verify parse errors and location hints.
Default namespace
Feed XML that needs a prefix mapping before XPath can match elements.
Multiple prefixes
SOAP-style payload with several namespaces for prefix-based XPath tests.
Comparison between SaxonJS and Saxon/C using the same evaluation axes.
Conclusion
Adopt SaxonJS as the primary XPath 2.0+ candidate for this site. It fits browser-side privacy, avoids server-side XML payload handling, and is easier to add to the current PHP pages than a native PHP extension.
Why the other option is not first
Saxon/C remains technically strong, but it adds native runtime packaging, PHP extension deployment, and operational overhead that do not match this lightweight PHP site.
| Axis | SaxonJS | Saxon/C |
|---|---|---|
| XPath 2.0+ support | Official SaxonJS materials describe XPath 3.1 coverage and a direct browser API. | Saxon/C also exposes XPath 3.1 through the PHP XPathProcessor API. |
| Namespace handling | Works with explicit static context and prefix mappings on the browser side. | Strong explicit namespace APIs are available in the PHP integration. |
| Integration with this PHP site | Fits the current browser-heavy tools and keeps user XML off the server. | Requires server-side integration and extension management before the page can run. |
| Deployment difficulty | Serve a JS runtime asset with page-specific loading. | Install and maintain native Saxon/C binaries and PHP bindings. |
| License notes | Available free of charge under the Saxonica Public License, but not open source. | Saxon/C HE is open source under MPL 2.0; PE and EE are commercial. |
| Performance | Adequate for pasted XML and interactive browser testing. | Likely stronger for large server-side workloads, but heavier than needed for v1. |
Install outline
Current environment