Skip to content

ConvertXMLStringToJToken - add a parameter to force arrays for certain elements #33

@jefim

Description

@jefim

We have a problem with converting:

  1. If XML object contains an array of items, then it will be correctly converted to an array in JToken
  2. However, if the XML only has one element in that array, then the JToken will not have the array. Instead it will be just that one object. This is because XML does not contain any additional metadata on whether a single element is an array or just a subproperty.

There are multiple ways of tackling this, one of which is providing a schema file for XML. However that is not something that everyone has and as a quick and simple to use workaround we should make a new parameter called "ConvertAsArrayPaths", which would contain an array of strings (XPaths) and use that during the conversion to determine whether we are supposed to output an array or a plain object.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions