PhoenixmlDb.XQuery 2.1.0

dotnet add package PhoenixmlDb.XQuery --version 2.1.0
                    
NuGet\Install-Package PhoenixmlDb.XQuery -Version 2.1.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="PhoenixmlDb.XQuery" Version="2.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="PhoenixmlDb.XQuery" Version="2.1.0" />
                    
Directory.Packages.props
<PackageReference Include="PhoenixmlDb.XQuery" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add PhoenixmlDb.XQuery --version 2.1.0
                    
#r "nuget: PhoenixmlDb.XQuery, 2.1.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package PhoenixmlDb.XQuery@2.1.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=PhoenixmlDb.XQuery&version=2.1.0
                    
Install as a Cake Addin
#tool nuget:?package=PhoenixmlDb.XQuery&version=2.1.0
                    
Install as a Cake Tool

PhoenixmlDb.XQuery

XQuery 4.0 query engine for PhoenixmlDb — query XML and JSON documents with the full power of XQuery.

Features

  • Full XQuery 4.0 — FLWOR expressions, constructors, modules, user-defined functions
  • XPath 4.0 — complete XPath implementation with 240+ built-in functions
  • JSON supportjson-doc(), parse-json(), maps, arrays — query JSON natively
  • Full-text searchcontains text with stemming, wildcards, proximity, scoring
  • Update Facility — insert, delete, replace, rename, transform expressions
  • Type system — records, enums, union types (XQuery 4.0)

Quick example

using PhoenixmlDb.XQuery.Execution;

var engine = new QueryEngine();

// Simple query
var results = engine.ExecuteToListAsync(
    "for $x in 1 to 10 where $x mod 2 = 0 return $x * $x");

// Query XML documents
var books = engine.ExecuteAsync(
    "//book[price > 30]/title",
    containerId);
Package Description
PhoenixmlDb.Core Core types and XDM data model (dependency)
PhoenixmlDb.Xslt XSLT 4.0 transformation engine
PhoenixmlDb.XQuery.Cli xquery command-line tool

Documentation

Full documentation at phoenixml.dev

License

Apache 2.0

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  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.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on PhoenixmlDb.XQuery:

Package Downloads
PhoenixmlDb.Xslt

XSLT 4.0 transformation engine for PhoenixmlDb

Phoenixml.Platform.Editor.Xml

XML/XSD vocabulary binding for Phoenixml.Platform — concrete IDocument and ITreeNodeProvider implementations against PhoenixmlDb.Core's XDM, XSD schema validation pipeline.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.1.0 0 9/17/2026
2.0.0 232 9/15/2026
1.8.0 241 9/14/2026
1.7.0 621 9/11/2026
1.6.15 167 9/9/2026
1.6.14 164 9/7/2026
1.6.13 145 9/4/2026
1.6.12 173 9/1/2026
1.6.11 146 8/29/2026
1.6.10 172 8/29/2026
1.6.9 229 8/27/2026
1.6.8 163 8/26/2026
1.6.7 169 8/24/2026
1.6.6 155 8/23/2026
1.6.5 150 8/21/2026
1.6.2 187 8/16/2026
1.6.1 199 7/31/2026
1.6.0 174 7/27/2026
1.5.5 202 7/12/2026
1.5.4 204 7/9/2026
Loading failed

Minor rather than patch: four error codes change, and `fn:implicit-timezone` becomes stable
within a query. Takes **PhoenixmlDb.Core 2.0.0** (Core runs its own cadence and did not move).

Part of the coordinated 2.1.0 train with **PhoenixmlDb.Xslt 2.1.0**. The two halves of the
XPath-evaluation performance work land together — see *Performance* below for why that pairing
is the number worth quoting.

### Behaviour changes — read this before upgrading

**1. `fn:implicit-timezone` is now stable within a query.** It read `DateTimeOffset.Now` on every
call, so two calls in one query could disagree, and it could disagree with `fn:current-dateTime`
in the same query. It now reads the instant the dynamic context captured, as a dynamic-context
component is specified to. A query that was (accidentally) observing clock drift between calls
will see one value.

**2. Four error codes are now the ones the specs name.** A query that catches by code must be
updated; a query that merely fails still fails.

| condition | was | now |
|---|---|---|
| a library module declares a **function** outside its target namespace | *(no error)* | `XQST0048` |
| a module namespace with a malformed percent escape | *(no error)* | `XQST0046` |
| an ambiguous leading lone `/` | wrong code, from the wrong exception type | `XPST0003` |
| a bad escape inside `<fn:string escaped="true">` (`fn:xml-to-json`) | `FOJS0006` | `FOJS0007` |

The first two were **not raised at all** — a library module declaring a function in another
namespace was imported silently. Code relying on that import now gets a static error.

### Added

- **`QueryExecutionContext.DynamicCallDepth`** lets a host function tell that it is running
 inside a dynamic function call. This exists for XSLT: `fn:current-output-uri()` must return the
 empty sequence during a dynamic call (spec bug 30411), and the `AbsentFocus` sentinel could not
 carry that signal because the XSLT engine pushes the same sentinel for an initial template with
 no context item.

### Performance

XPath evaluation now pays per-call-site and per-context setup once instead of per evaluation:
call sites cache what they resolved (revalidated against a `FunctionLibrary.Version` counter, so
a plan shared across executions or threads cannot use another library's function), context state
is created on first use, the three focus stacks become one, and atomization stops allocating a
closure per call.

ISO Schematron three-step compile of 77 state schematrons, sequential:

| | Total | Include step |
|---|---|---|
| 2.0.0 | 5.93 min | 3.81 min |
| this release alone | 4.99 min | 2.98 min |
| **with PhoenixmlDb.Xslt 2.1.0** | **3.97 min** | **2.06 min** |

The last row is what a consumer on the 2.1.0 train actually gets: **46% off the include step.**
Either half alone gets roughly half of it, which is why these two releases are cut together.

All 231 compile-step outputs are byte-identical to 2.0.0's.

### Conformance

**W3C QT3 29,822 / 31,379 (95.0%)**, up from 29,813 on 2.0.0. The nine are the error-code fixes
above landing on cases that assert the code.

The performance work moved nothing: measured on `41cea23` with it and on `0cd012a` without it,
both runs report the same 29,822 / 31,379 and the same 1,557 failures. That is the result a
change about allocation should produce, and it was measured here rather than taken from the
branch that claimed it.

XQuery unit suite: **1,856 passed, 0 failed** on `net10.0`.