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

ConvertXMLStringToJToken

Convert XML string to JToken.

Task version: 2.1.0

Required Frends version: 5.5+

Required .NET version: 6.0

Compatible Agents: Crossplatform

Task Parameters

Name
Description

XML : String

XML string to convert.

Default: - Example: bar

Name
Description

TypeCorrection : TypeCorrectionMode

Whether and how to convert string values into native JSON numbers and booleans.

None leaves all values as strings (default). Attributes reads inline xsi:type hints

from the XML. Schema derives the types from the supplied XSD.

Possible values:

  • None: Whether and how to convert string values into native JSON numbers and booleans.

None leaves all values as strings (default). Attributes reads inline xsi:type hints

from the XML. Schema derives the types from the supplied XSD.

  • Attributes: Whether and how to convert string values into native JSON numbers and booleans.

None leaves all values as strings (default). Attributes reads inline xsi:type hints

from the XML. Schema derives the types from the supplied XSD.

  • Schema: Whether and how to convert string values into native JSON numbers and booleans.

None leaves all values as strings (default). Attributes reads inline xsi:type hints

from the XML. Schema derives the types from the supplied XSD.

Default: 0 Example: TypeCorrectionMode.Attributes

XSD : String

XSD schema used to validate the XML and to derive value types and array mapping.

Only used (and shown) when TypeCorrection is Schema.

Default: - Example: <xs:schema xmlns:xs='http://www.w3.org/2001/XMLSchema'>...</xs:schema>

ActionOnBadValues : BadValueAction

What to do when a value carries a recognized numeric/boolean type hint but cannot be

parsed as that type (e.g. xsi:type="int" with value "abc"). Ignore (default) keeps the

unparseable value as a JSON string. Throw raises an exception identifying the element

and value. Only used (and shown) when TypeCorrection is Attributes or Schema.

Possible values:

  • Ignore: What to do when a value carries a recognized numeric/boolean type hint but cannot be

parsed as that type (e.g. xsi:type="int" with value "abc"). Ignore (default) keeps the

unparseable value as a JSON string. Throw raises an exception identifying the element

and value. Only used (and shown) when TypeCorrection is Attributes or Schema.

  • Throw: What to do when a value carries a recognized numeric/boolean type hint but cannot be

parsed as that type (e.g. xsi:type="int" with value "abc"). Ignore (default) keeps the

unparseable value as a JSON string. Throw raises an exception identifying the element

and value. Only used (and shown) when TypeCorrection is Attributes or Schema.

Default: 0 Example: BadValueAction.Throw

Task Result

Name
Description

Success : Boolean

Operation complete without errors. Example: true

Jtoken : Object

JToken. Example: {{ "?xml": { "@version": "1.0", "@standalone": "no" }, "root": { "foos": { "@id": "1", "foo": "bar" } }}}

Task Changelog

Changelog for Task Frends.JSON.ConvertXMLStringToJToken.

[2.1.0] - 2026-06-11

Fixed

  • Fix a case when we want to return null value for non-string types.

[2.0.0] - 2026-05-27

Breaking

  • The XSD parameter has moved from the Input tab to the Options tab and is now only used (and shown) when TypeCorrection is Schema.

    • Why this is breaking: the XSD is no longer bound where existing process references expect it. A migration (migration.json) ships with the package to copy Input.XSDOptions.XSD and set TypeCorrection = Schema automatically, but tenants that do not apply migration.json will not migrate automatically. On those tenants the old XSD value is dropped, so XSD-driven array mapping (added in 1.2.0) silently stops working.

    • Upgrade path (manual, for tenants without migration support): after updating each affected process step, open the Options tab, set TypeCorrection = Schema, and paste your XSD into Options.XSD. This restores the previous array-mapping behaviour. Steps that never used an XSD need no changes — leave TypeCorrection = None.

Added

  • Added Options parameter with TypeCorrection (None/Attributes/Schema) to convert numeric and boolean XML values into native JSON types, via inline xsi:type attributes (Attributes) or the supplied XSD (Schema). Default is None.

Changed

  • In Schema mode the XSD now drives both array mapping and value typing. Schema mode without an XSD is a graceful no-op (returns string values) rather than an error.

[1.2.0] - 2026-05-07

Added

  • Added optional XSD input support to ensure consistent array/object mapping

[1.1.0] - 2024-08-20

Updated

  • Updated Newtonsoft.Json library to the latest version 13.0.3.

[1.0.1] - 2023-11-28

Fixed

  • Fixed Return Jtoken type to dynamic.

[1.0.0] - 2023-02-13

Added

  • Initial implementation

Last updated

Was this helpful?