Known Limitations
goxpath passes 85% of the W3C QT3 XPath 3.1 conformance tests (~18,900 of ~22,200 applicable tests). The following areas have known gaps.
Regular Expressions
Go’s standard regexp library uses the RE2 engine, which does not support back-references (\1, \2). XPath patterns using back-references will fail with a compile error.
(: NOT SUPPORTED :)
matches("abab", "(ab)\1") (: back-reference to group 1 :)Character class subtraction ([a-z-[aeiou]]) is handled by removing the subtracted part, which may produce incorrect results for some patterns.
Integer Precision
xs:integer is stored as Go int (int64), limiting the range to approximately ±9.2 × 10¹⁸. Values beyond this range overflow silently. The XPath specification requires arbitrary-precision integers.
(: May lose precision :)
xs:integer("999999999999999999999") (: beyond int64 range :)
format-number(1E25, '#') (: outputs max int64, not 10^25 :)Decimal Precision
xs:decimal is stored as Go float64, providing ~15-17 significant digits. True arbitrary-precision decimal arithmetic is not implemented.
Timezone Handling
Go’s time.Time does not distinguish between “no timezone specified” and “UTC timezone”. This means:
(: May produce "Z" where no timezone is expected :)
string(xs:time("13:20:00")) (: may show "13:20:00Z" instead of "13:20:00" :)Date/time serialization may add or omit timezone indicators in edge cases.
Unicode Collation
The Unicode Collation Algorithm (UCA) is not implemented. Functions that accept a collation argument (compare(), contains(), etc.) accept the argument but use simple codepoint comparison.
Not Implemented
The following XPath 3.1 features are not available:
| Feature | Notes |
|---|---|
fn:transform() |
Requires XSLT processor integration |
fn:xml-to-json() |
Partial implementation |
fn:collation-key() |
Requires UCA |
fn:idref() |
Requires DTD/Schema ID resolution |
try/catch expressions |
XQuery-only feature (not in XPath 3.1) |
| Schema-aware types | No XML Schema validation |
namespace:: axis |
Not implemented |
format-number Gaps
- Exponent patterns with
#as sole integer digit may produce wrong mantissa in edge cases - Fraction grouping (
#.#,##,#) is not fully implemented - Large numbers exceed int64 range
- Named decimal formats require registration via the Go API (not auto-discovered)
format-date / format-dateTime / format-time Gaps
- Non-English word formatting (
[YWw]in German, French, Italian) is not supported — only English words - IANA timezone conversion (5th argument) is not implemented
- Calendar systems other than ISO are not supported
- Digit families in timezone output are not translated