For the complete documentation index, see llms.txt. This page is also available as Markdown.

XPathQuery

Queries XML for data using XPath query.

Task version: 2.2.0

Required Frends version: 5.5+

Required .NET version: 6.0

Compatible Agents: Crossplatform

Task Parameters

Name
Description

XML : String

XML to be queried.

Default: - Example:Everyday Italian

XPathQuery : String

The XPath Query

Default: - Example: /book/title/text()

Name
Description

ThrowErrorOnEmptyResults : Boolean

Throw an exception if no results returned by query

Default: true Example: true

XPathVersion : XPathVersion

XPath Query language version. Version 1.0 is not supported.

V31 = 3.1

V30 = 3.0

V20 = 2.0

Possible values:

  • V31: XPath Query language version. Version 1.0 is not supported.

V31 = 3.1

V30 = 3.0

V20 = 2.0

  • V30: XPath Query language version. Version 1.0 is not supported.

V31 = 3.1

V30 = 3.0

V20 = 2.0

  • V20: XPath Query language version. Version 1.0 is not supported.

V31 = 3.1

V30 = 3.0

V20 = 2.0

Default: 0 Example: XPathVersion.V31

ReturnRawXmlForNonAtomicValues : Boolean

Enables the Task to return the raw xml values for non atomic values.

Default: False Example: true

SchemaAware : Boolean

Enable schema aware processing.

Default: False Example: true

SchemaValidationMode : SchemaValidationMode

Schema validation mode.

Possible values:

  • None: Schema validation mode.

  • Lax: Schema validation mode.

  • Strict: Schema validation mode.

Default: 0 Example: SchemaValidationMode.None

EnableExternalEntities : Boolean

Controls whether external entities are allowed in the XML processing.

Default: - Example: false

Task Result

Name
Description

Data : Object

Data of the query. Example: [ "value123", 546, true, { "someObject": "hello" } ]

Task Changelog

Changelog for Task Frends.XML.XPathQuery.

[2.2.0] - 2026-07-14

Changed

  • Updated outdated repository URLs

[2.1.0] - 2026-02-12

Fixed

  • Prevent XML External Entity (XXE) attack, by adding option to disable External Entities

[2.0.0] - 2025-04-08

Added

  • Upgrade dependencies

    • Saxon 12.0.0 -> 12.5.0

    • Newtonsoft.Json 12.0.3 -> 13.0.3

  • Adding option SchemaAware, with default value false

    • The default value the same as was before, so this will not break existing task usage.

  • [Breaking] Adding option SchemaValidationMode, with default value None

    • The default value None is different from the previously used Lax mode.

    • To maintain the same behavior as before, set SchemaValidationMode to Lax.

[1.1.0] - 2023-08-14

Added

  • Added option to return raw xml data instead of JToken.

[1.0.1] - 2023-01-20

Fixed

  • Fixed text() query handling, so task no longer crashes (issue #13)

[1.0.0] - 2023-01-19

Added

  • Initial implementation

Last updated

Was this helpful?