fast-xml-parser icon indicating copy to clipboard operation
fast-xml-parser copied to clipboard

XML parse looks good on Online tool, but when using API crashes

Open hectorgrecco opened this issue 2 years ago • 2 comments

  • [x] Are you running the latest version?
  • [x] Have you included sample input, output, error, and expected output?
  • [x] Have you checked if you are using correct configuration?
  • [x] Did you try online tool?

Description

When I'm parsing a specific XML using the API, the package crashes and throws the error on the image. But, when I use the online validator, it does not. Whats happening?

Code

const options = {
        numberParseOptions: {
          leadingZeros: true,
          hex: true,
          skipLike: /\+[0-9]{10}/,
        },
        trimValues: true,
        removeNSPrefix: true,
        processEntities: false,
        parseTagValue: true,
      };
    
      const parser = new XMLParser(options);
      return parser.parse(xmlData);

Output

image

expected data

Don't throw an error

Would you like to work on this issue?

  • [ ] Yes
  • [x] No

hectorgrecco avatar Mar 20 '24 11:03 hectorgrecco

We're glad you find this project helpful. We'll try to address this issue ASAP. You can vist https://solothought.com to know recent features. Don't forget to star this repo.

github-actions[bot] avatar Mar 20 '24 11:03 github-actions[bot]

How big your file is? Can you post the content here? Can you try to set contents in a string and try? Probably there are some invalid characters in the XML.

amitguptagwl avatar Mar 21 '24 08:03 amitguptagwl

closing as no response. feel free to reopen it for further discussion

amitguptagwl avatar Sep 21 '24 03:09 amitguptagwl