簡體   English   中英

解析 XML 文件,其中一些記錄(xml)被分成多行?

[英]Parsing an XML file in which some records(xml) are split across multiple lines?

There is a code deployed which parses xml file line by line but at a times xml file contains record(xml) which is split across different line how to tackle that because deployed code uses readline() function of python therefore there is an error when the由於存在未關閉的令牌問題,記錄(xml 輸入)被拆分為多行。 所以我們必須刪除那條記錄。 有什么方法可以解決問題。

沒有錯誤

 <SegmentTag> "Data is present in one line" </SegmentTag>

即使標簽已關閉但出現在多行中,也與未關閉相關的錯誤。 如何在不更改 readline() function 的情況下解析這些類型的記錄。

 <SegmentTag> "Data is spread across multiple lines..." </SegmentTag>

不要嘗試將 XML 視為普通文本:始終使用 XML 解析器。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM