Skip to content

Can we configure the value of empty node to be an empty object instead of empty string while parsing xml #502

@qbert-007

Description

@qbert-007

Checklist

  • Have you asked your question on Stackoverflow or similar forum?
  • Are you running the latest version?
  • Have you included sample input, output, error, and expected output?
  • Have you checked if you are using correct configuration?
  • Did you try online tool?

Input

Code

let xmlData = '<any_name></any_name>'
const parser = new XMLParser({});
let jsonObj = parser.parse(xmlData);
console.log(jsonObj)

Output

{"any_name":""}

expected data

{"any_name":{}}
Would you like to work on this issue?

  • Yes
  • No

Bookmark this repository for further updates.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Feature-RequestNew features suggested by users

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions