xquery4 1.6.13
these previous versions should be considered unusabl e due to the lack of proper parser implementation features. Versions 2.0 and above are a closer match to the standards.
See the version list below for details.
dotnet tool install --global xquery4 --version 1.6.13
dotnet new tool-manifest
dotnet tool install --local xquery4 --version 1.6.13
#tool dotnet:?package=xquery4&version=1.6.13
nuke :add-package xquery4 --version 1.6.13
xquery
Command-line XQuery 3.1/4.0 processor for .NET. Query XML documents from the terminal using the PhoenixmlDb XQuery engine.
Installation
dotnet tool install -g xquery4
Usage
# Query an XML file
xquery '//book/title' library.xml
# Count elements
xquery 'count(//item)' catalog.xml
# Read from a query file
xquery -f transform.xq input.xml
# Query a directory of XML files
xquery 'collection()//product[price > 50]' ./data/
# JSON output
xquery -o json 'map { "count": count(//item) }' data.xml
# Read from stdin
cat data.xml | xquery '//item/@name'
# Show execution plan
xquery --plan 'for $x in 1 to 10 return $x * $x'
# Show timing breakdown
xquery --timing '//item' large-catalog.xml
Features
- XQuery 3.1/4.0 — FLWOR, maps/arrays, higher-order functions, string constructors
- Multiple output methods — adaptive, XML, text, JSON
- Context item — input XML is available as
.(standard XQuery) - Multiple sources — files, directories, URLs, stdin
- Full prolog support — namespaces, variable/function declarations, serialization options
- Execution plans — inspect how queries are compiled and optimized
- Timing — built-in performance profiling
Documentation
Full documentation at phoenixml.dev
License
Apache-2.0
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
This package has no dependencies.
| Version | Downloads | Last Updated | |
|---|---|---|---|
| 2.9.0 | 226 | 10/15/2026 | |
| 2.8.0 | 113 | 10/9/2026 | |
| 2.7.0 | 107 | 10/7/2026 | |
| 2.6.0 | 135 | 10/6/2026 | |
| 2.5.1 | 127 | 10/1/2026 | |
| 2.4.1 | 129 | 9/28/2026 | |
| 2.4.0 | 113 | 9/28/2026 | |
| 2.2.0 | 660 | 9/25/2026 | |
| 2.1.0 | 115 | 9/17/2026 | |
| 2.0.0 | 126 | 9/15/2026 | |
| 1.8.0 | 141 | 9/14/2026 | |
| 1.7.0 | 144 | 9/11/2026 | |
| 1.6.15 | 140 | 9/9/2026 | |
| 1.6.14 | 150 | 9/7/2026 | |
| 1.6.13 | 136 | 9/4/2026 | |
| 1.6.12 | 142 | 9/1/2026 | |
| 1.6.11 | 147 | 8/29/2026 | |
| 1.6.10 | 148 | 8/29/2026 | |
| 1.6.9 | 146 | 8/27/2026 | |
| 1.6.8 | 138 | 8/26/2026 |
Two fixes, both the same mistake: a spec-defined operation on `xs:QName` delegating to
`QName.ToString()`, which renders the EQName form `Q{uri}local` as soon as an expanded namespace
is attached. That is a good rendering for a debugger and the wrong one for a value.
This release exists to unblock the XSLT engine. There, `$err:code` could not carry its namespace
URI at all — attaching one changed how the value printed — so a caught error code could never
compare equal to `QName('http://www.w3.org/2005/xqt-errors', 'XTTE0570')`, which is how a
stylesheet (and XSpec) asserts on an error code.
### Casting `xs:QName` to `xs:string` gave the EQName form, not the lexical one
`ConcatFunction.XQueryStringValue` had no QName branch, so the value fell through to
`QName.ToString()`. XPath 3.1 §19.2 requires the lexical form — `prefix:local`, or the bare local
name when there is no prefix.
### `fn:deep-equal` compared QNames by their debug rendering
It fell through to `string.Equals(a.ToString(), b.ToString())`. So the same name spelled two ways
— `Q{uri}local` from a QName carrying an expanded namespace, `prefix:local` from one carrying
only a runtime namespace — compared **unequal**. It now compares namespace URI plus local name
and ignores the prefix: the identical rule the `eq` operator has always applied a few hundred
lines away in the same file. `deep-equal` simply never reached it.
That one was masking a defect in the XSLT engine as well. XSpec's `catch_stylesheet` asserts an
error code against `xs:QName('error-code-of-my-template')`; three of those assertions passed only
because a namespace difference is invisible when both sides render as the bare local name.
Comparing by value turned them red, which is how the XSLT-side bug (an `xmlns=` default leaking
into `xs:QName()` casts) was found and fixed.
`PhoenixmlDb.Core`'s `QName.ToString` is deliberately untouched: the two renderings serve
different audiences, and the fix belongs where the spec-defined conversion happens rather than in
a general-purpose `ToString`.
Measured with the companion XSLT changes on XSpec's 284-suite corpus: five suites better, and the
three that an earlier attempt at this regressed (`yes-no-utils`, `xsl-result-document`,
`external_xslt-package_arith_private`) all back to baseline.