Skip to content

Failure to recognize xml attributes without whitespace (but with line breaks) #350

@ttu-ttu

Description

@ttu-ttu
  • 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?

Description

fast-xml-parser does not treat attributes separated by (only) line breaks as attributes.

Input

<?xml version="1.0"?>
<abc
attrA="2"
>
value
</abc>

Code

parser.parse(`<?xml version="1.0"?>
<abc
attrA="2"
>
value
</abc>`, {
  ignoreAttributes: false,
});

Output

{
    "abc\nattrA=\"2\"\n": "value"
}

expected data

{
    "abc": {
        "#text": "value",
        "@_attrA": "2"
    }
}

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