Skip to content

XML prolog is included as "?xml" property in json output #774

@ulrichstark

Description

@ulrichstark
  • 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?
  • Have you checked the docs for helpful APIs and examples?

Description

  1. Go to https://naturalintelligence.github.io/fast-xml-parser
  2. Click "Parse to JSON"
  3. Click "Parse to XML"
  4. Click "Parse to JSON"
  5. See error "Error: XML declaration allowed only at the start of the document.:2:6" in JSON panel

Input

(any XML code containing the prolog)

Code

<?xml version="1.0" encoding="UTF-8"?>
<note>
  <to>Tove</to>
  <from>Jani</from>
  <heading>Reminder</heading>
  <body>Don't forget me this weekend!</body>
</note>

Output

{
    "?xml": "",
    "note": {
        "to": "Tove",
        "from": "Jani",
        "heading": "Reminder",
        "body": "Don't forget me this weekend!"
    }
}

expected data

{
    "note": {
        "to": "Tove",
        "from": "Jani",
        "heading": "Reminder",
        "body": "Don't forget me this weekend!"
    }
}

Would you like to work on this issue?

  • Yes
  • No

Bookmark this repository for further updates. Visit SoloThought to know about recent features.

Metadata

Metadata

Assignees

No one assigned

    Labels

    first-timers-onlyPosts tagged with this label are reserved for first time contributors onlygood first issue

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions