Skip to content

component xmltojson

Raymond Meester edited this page Mar 7, 2023 · 2 revisions

Converts an XML to JSON.

Path

Path can be empty.

Options

Name Description Default Type
forceTopLevelObject Determines whether the resulting JSON will start off with a top-most element whose name matches the XML root element. If disabled, XML string 12 turns into { 'x: '1', 'y': '2' }. When enabled it turns into { 'a': { 'x: '1', 'y': '2' }}. Boolean
skipwhitespace Determines whether white spaces between XML elements will be interpreted as text values or will be ignored. Boolean
trimSpaces Determines whether leading and trailing white spaces will be omitted from String values. Boolean
skipNamespaces Signals whether namespaces should be ignored. By default they will be added to the JSON output using @xmlns elements Boolean
removeNamespacePrefixes Removes the namespace prefixes from XML qualified elements, so that the resulting JSON string does not contain them. Boolean
typeHints Adds type hints to the resulting XML to aid conversion back to JSON. Used for unmarshalling (JSON to XML conversion). Boolean
Clone this wiki locally