Skip to content

Parse attr failed when the attr text has ">" #167

@heywooooorld

Description

@heywooooorld

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

image

Code

  let xmlStr = '<P><G ch="aaa>"/><G ch="bb"/></P>';
  let result = fastXmlParser.parse(xmlStr, {
    attrNodeName: '$',
    textNodeName: '#text',
    attributeNamePrefix: '',
    ignoreAttributes: false,
    allowBooleanAttributes: true,
    trimValues: true
  });
  console.log(result);

Output

{ P: { G: { '#text': '"/>', '$': [Object], G: [Object] } } }

expected data

{ P: { G: [Object, Object] } } }

Would you like to work on this issue?

  • Yes
  • No

Bookmark this repository for further updates.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions