xquery4 2.5.1

There is a newer version of this package available.
See the version list below for details.
dotnet tool install --global xquery4 --version 2.5.1
                    
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest
                    
if you are setting up this repo
dotnet tool install --local xquery4 --version 2.5.1
                    
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=xquery4&version=2.5.1
                    
nuke :add-package xquery4 --version 2.5.1
                    

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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

Version Downloads Last Updated
2.8.0 0 10/9/2026
2.7.0 47 10/7/2026
2.6.0 73 10/6/2026
2.5.1 84 10/1/2026
2.4.1 86 9/28/2026
2.4.0 67 9/28/2026
2.2.0 341 9/25/2026
2.1.0 76 9/17/2026
2.0.0 76 9/15/2026
1.8.0 85 9/14/2026
1.7.0 80 9/11/2026
1.6.15 80 9/9/2026
1.6.14 96 9/7/2026
1.6.13 82 9/4/2026
1.6.12 82 9/1/2026
1.6.11 87 8/29/2026
1.6.10 87 8/29/2026
1.6.9 82 8/27/2026
1.6.8 80 8/26/2026
1.6.7 89 8/24/2026
Loading failed

A patch for a schema-loading defect that PhoenixmlDb.Xslt's release testing exposed. PhoenixmlDb.Xslt
2.5.1 requires this release.

### Fixed

**A schema referencing `xml:id` could fail to import, depending on the runtime.** `XsdSchemaProvider`
keeps one schema for the XML namespace, because two copies cannot compile together. It kept
whichever copy enumerated first. When a schema imports that namespace without a location, .NET adds
its own built-in copy, which declares no `xml:id`. On some runtimes that copy came first, so a
host's fuller copy (PhoenixmlDb.Xslt seeds one into its default provider) was discarded, and
importing a schema that references `xml:id` failed with "the xml:id attribute is not declared". The
most complete copy is now kept.

### Conformance

QT3: no change from 2.5.0.

### `xquery` CLI (ships on `cli-v2.5.1`)

- Runs on **PhoenixmlDb.Xslt 2.5.1**, so `fn:transform` from a query gets the 2.5.x engine
 fixes and enforces a configured `ResourcePolicy`. The CLI sets no policy itself, so its
 behaviour is unchanged. There was no `cli-v2.5.0`.