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

ConvertToXML

Converts CSV string content to XML string.

Task version: 1.6.0

Required Frends version: 5.7+

Required .NET version: 8.0

Compatible Agents: Crossplatform

Task Parameters

Name
Description

Csv : String

Input csv string

Default: - Example: 1;Foo;Bar

Delimiter : String

Delimiter.

Default: ; Example: ;

ColumnSpecifications : ColumnSpecification[]

You can map columns to specific types.

The order of the columns are used for mapping, that means that the ColumnSpecification elements need to be created in the same order as the CSV fields.

Default: - Example: [ { foo, String } ]

Name
Description

ContainsHeaderRow : Boolean

This flag tells the reader if there is a header row in the CSV string.

Default: true Example: true

TrimOutput : Boolean

This flag tells the reader to trim whitespace from the beginning and ending of the field value when reading.

Default: true Example: true

SkipRowsFromTop : Int32

If the CSV string contains metadata before the header row you can set this value to ignore a specific amount of rows from the beginning of the csv string.

Default: 0 Example: 2

SkipEmptyRows : Boolean

A flag to let the reader know if a record should be skipped when reading if it's empty.

A record is considered empty if all fields are empty.

Default: true Example: true

ReplaceHeaderWhitespaceWith : String

If intended header value contains whitespaces replace it(them) with this string, default action is to do nothing.

Default: Example: " "

CultureInfo : String

The culture info to read/write the entries with, e.g. for decimal separators.

InvariantCulture will be used by default.

See list of cultures here: https://learn.microsoft.com/en-us/dotnet/api/system.globalization.cultureinfo.name?view=net-7.0

NOTE: Due to an issue with the CsvHelpers library, all CSV tasks will use the culture info setting of the first CSV task in the process; you cannot use different cultures for reading and parsing CSV files in the same process.|

Default: - Example: fi-FI

TreatMissingFieldsAsNulls : Boolean

The flag for reader to treat missing fields as nulls instead of throwing a MissingFieldException.

In case of providing column specifications manually the value of empty field defined as string will be empty instead of null

Default: true Example: true

XmlRootElementName : String

Specifies the name for the XML root element.

Default: Root Example: Root

XmlRowElementName : String

Specifies the name for the XML row element.

Default: Row Example: Row

IgnoreQuotes : Boolean

A flag to let the reader know if quotes should be ignored.

Default: false Example: false

IllegalNodeNameAction : IllegalNodeNameAction

If a converted node name is illegal, a selected action will be taken.

Possible values:

  • ThrowError: If any illegal node name is encountered, a task will throw an error

  • Overwrite: Any illegal character will be replaced with "{ASCII hexcode}" string

Node name started with number will have a prefix added

Default: ThrowError Example: ThrowError

IllegalNodeNamePrefix : String

A prefix that will be added to illegal node names. If it's empty, the prefix will be "_"

Default: - Example: Pref

ThrowErrorOnFailure : Boolean

Whether to throw an error on failure.

Default: True Example: true

ErrorMessageOnFailure : String

Overrides the error message on failure.

Default: - Example: CSV conversion to XML failed: invalid input

Task Result

Name
Description

Success : Boolean

Indicates whether the operation completed successfully. Example: true

Xml : String

Result as XML. Example: 1

Error : Error

Error details. Null when Success is true. Example: null

Error.Message : String

Error message describing the failure. Example: CSV input can not be empty

Error.AdditionalInfo : Exception

Additional information about the error, typically the original exception. Example: null

Task Changelog

Changelog for Task Frends.CSV.ConvertToXML.

[1.6.0] - 2026-08-24

Changed

  • Target framework updated from net6.0 to net8.0.

  • Added error handling support with ThrowErrorOnFailure and ErrorMessageOnFailure options.

  • Added Error property to the Result object for capturing failure details when ThrowErrorOnFailure is false.

[1.5.0] - 2026-01-21

Added

  • Add options to fix illegal node names. The default behavior is throwing an error if the node name is invalid.

[1.4.0] - 2025-12-29

Added

  • Add option to ignore quotes.

[1.3.0] - 2025-12-05

Changed

  • Update package CsvHelper to version 33.1.0.

[1.2.0] - 2025-10-06

Changed

  • Updated Repository link in the metadata.

[1.1.0] - 2024-08-20

Added

  • Updated NewtonSoft.Json to the latest version 13.0.3.

[1.0.0] - 2023-08-24

Added

  • Initial implementation

Last updated

Was this helpful?