TLio.Xml 1.5.0-preview.5

This is a prerelease version of TLio.Xml.
There is a newer version of this package available.
See the version list below for details.
dotnet add package TLio.Xml --version 1.5.0-preview.5
                    
NuGet\Install-Package TLio.Xml -Version 1.5.0-preview.5
                    
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="TLio.Xml" Version="1.5.0-preview.5" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="TLio.Xml" Version="1.5.0-preview.5" />
                    
Directory.Packages.props
<PackageReference Include="TLio.Xml" />
                    
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 TLio.Xml --version 1.5.0-preview.5
                    
#r "nuget: TLio.Xml, 1.5.0-preview.5"
                    
#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 TLio.Xml@1.5.0-preview.5
                    
#: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=TLio.Xml&version=1.5.0-preview.5&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=TLio.Xml&version=1.5.0-preview.5&prerelease
                    
Install as a Cake Tool

TLio.Xml

The XML adapter for TLio — INodeAdapter and IItemsFetcher implementations backed by System.Xml.Linq.

dotnet add package TLio.Xml
dotnet add package TLio.Client

Paths anchor on the document node

Exactly as XPath defines it: / is the document node (not an element — it selects nothing), /order is the document element, and /order/customer a child of it. The document element is always named in the path.

A bare customer is child::customer of the document node and matches nothing — relative steps never skip a level. Use //customer for "at any depth".

Fetcher Factory Path style Supports
Slash-path XmlExecutionContext.CreateWithSlashPaths() /order/address/city simple hierarchies, *, //
Native XPath XmlExecutionContext.CreateWithNativeXPath() /order/address/city, //name, /order/item[@id='1'] full XPath 1.0

Quick start

using System.Xml.Linq;
using TLio.Client;
using TLio.Xml;

// Parse through the adapter: it returns an element still attached to its XDocument,
// and that document node is what makes absolute paths resolve. A hand-built,
// detached XElement will not.
var data = new XmlNodeAdapter().Parse(
    "<order><customer><name>Acme</name></customer><tempId>7</tempId></order>");

var script = """
[
  { "command": "put",    "path": "/order/status", "value": "active" },
  { "command": "remove", "path": "/order/tempId" }
]
""";

var options = ParseOptions<XElement>.CreateDefault();
var engine  = new ScriptEngine<XElement>(options.CommandsProvider, options.FunctionsProvider);

var result = engine.Execute(script, data, XmlExecutionContext.CreateWithSlashPaths());

XML specifics

  • An array is an element whose children share one name, with either more than one child or the canonical item name item. IsObject and IsArray are mutually exclusive.
  • An empty element is null, "", {} and [] at once. It reads as null and as a container a property can be written into — which is what makes deep-path add work.
  • Renaming the document element (<order> → <opdracht>) is the rename command. move with toPath: "/" replaces the document body but keeps the element's name.

License

MIT — see the repository.

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 is compatible.  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

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.6.0-preview.1 123 11/3/2026
1.5.2 99 11/16/2026
1.5.1 150 11/2/2026
1.5.0 118 11/2/2026
1.5.0-preview.5 60 11/2/2026
1.5.0-preview.3 92 10/23/2026
1.5.0-preview.2 70 10/23/2026
1.5.0-preview.1 73 10/22/2026
1.4.1 124 10/22/2026
1.4.0 129 10/19/2026
1.3.0 116 10/19/2026
1.3.0-preview.9 60 10/19/2026
1.3.0-preview.8 60 10/19/2026
1.3.0-preview.7 60 10/19/2026
1.3.0-preview.6 59 10/19/2026
1.3.0-preview.5 63 10/19/2026
1.3.0-preview.4 69 10/19/2026
1.3.0-preview.3 75 10/18/2026
1.3.0-preview.2 67 10/18/2026
1.3.0-preview.1 79 10/12/2026
Loading failed