[英]Read failed for <filename> Details not well formed(invalid token)
I have been trying to parsing one xml file through npm package node-expat there certain xml file我一直在尝试通过 npm package node-expat 解析一个 xml 文件,那里有某些 xml 文件
<?xml version="1.0" encoding="utf-8"?><root><header><documentType>ItemFulfillment</documentType></header><record id="1"><Document_Number>IF0916382</Document_Number><Picked_Date>2022-05-06T16:45:04.543</Picked_Date><Reference_Number>IF0916382</Reference_Number><Item><Itemline><Item>GSW0145-GR02 : GSW0145-GR02-1/2</Item><OrderedQuantity>1.00000</OrderedQuantity><ShippedQuantity>1.00000</ShippedQuantity><UPC>019624238898</UPC></Itemline><Itemline><Item>GSW0144-GR02 : GSW0144-GR02-1/2</Item><OrderedQuantity>1.00000</OrderedQuantity><ShippedQuantity>1.00000</ShippedQuantity><UPC>019624272588</UPC></Itemline></Item><Packaging><PackageLine><Tracking_Number>1ZEW5167YW14791144</Tracking_Number><Weight>1.20000</Weight></PackageLine></Packaging><Shipping_Addressee>Katherine Hooks</Shipping_Addressee><Shipping_Address_1>815 Edwards Road</Shipping_Address_1><Shipping_Address_2>Unit 20</Shipping_Address_2><Shipping_City>Greenville</Shipping_City><Shipping_Country>US</Shipping_Country><Shipping_Zip>29615</Shipping_Zip><Shipping_State_Province>SC</Shipping_State_Province></record></root>
This files works in almost all cases but sometimes it fails.Getting following error Read failed for Details not well formed(invalid token)此文件在几乎所有情况下都有效,但有时会失败。出现以下错误 Read failed for Details not well-formed(invalid token)
You can check below npm package for parsing XML.你可以查看下面的 npm 包来解析 XML。
https://www.npmjs.com/package/fast-xml-parser https://www.npmjs.com/package/fast-xml-parser
If you want to use you same npm package then please check the below image for your reference.如果您想使用相同的 npm 包,请查看下图以供参考。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.