Work Around, Error: XML document structures must start and end within the same entity
Work Around, Error: XML document structures must start and end within the same entity
首先声明我是编程新手 XML,我愿意接受社区可以提供的任何支持。
背景: 我正在用 Matlab 编写自己的 XML 解析脚本,以支持实时数据处理必不可少的项目。我在加载和解析 'non-real time' XML 文件时没有问题。我遇到的问题是实时 XML 文件。产生的错误是:XML 文档结构必须在同一实体内开始和结束。
说明: 我正在使用专有软件生成这些实时 XML 文件。当我点击数据采集程序上的'generate real time XML data'按钮时。它在我选择的目录中生成两个文件。第一个是 xml_smf(这是零字节,我无法打开)。第二个是 xml 文件,它的大小会随着时间的推移而增长(随着实时数据的获取并放入 xml 文件)。
此实时 XML 文件的问题在于它们不包含结束标记,因此会引发 'XML document structures must start and end within the same entity' 错误。当我点击我的数据采集程序上的 'stop generating real time XML data' 按钮时。 xml_smf 文件消失,xml 文件最终更新为结束标记。问题是我需要程序实时读取数据,而不需要现场用户不断地点击数据采集程序上的stop/start按钮。
我的问题如下:
有没有人使用过 XML_SMF 文件?关于它们的用途有什么建议吗?
是否有我可以在 Matlab 中应用的变通方法,以打开 XML 文件并在其后附加正确的结束标记?
对于可以处理实时数据(在 Matlab 中)的工作流程,您有什么建议吗?我正在描绘某种循环,其中每 30 秒左右重新处理越来越大的 XML 文件。
直到文件为well-formed, it's not XML. If its only issue is a missing close tag for the root element, simply read the file as text and write it out with the missing closing tag. (Hopefully you won't also have to contend with the file being held open for writing by another process.) Then read it as XML. If there are more problems, see
首先声明我是编程新手 XML,我愿意接受社区可以提供的任何支持。
背景: 我正在用 Matlab 编写自己的 XML 解析脚本,以支持实时数据处理必不可少的项目。我在加载和解析 'non-real time' XML 文件时没有问题。我遇到的问题是实时 XML 文件。产生的错误是:XML 文档结构必须在同一实体内开始和结束。
说明: 我正在使用专有软件生成这些实时 XML 文件。当我点击数据采集程序上的'generate real time XML data'按钮时。它在我选择的目录中生成两个文件。第一个是 xml_smf(这是零字节,我无法打开)。第二个是 xml 文件,它的大小会随着时间的推移而增长(随着实时数据的获取并放入 xml 文件)。
此实时 XML 文件的问题在于它们不包含结束标记,因此会引发 'XML document structures must start and end within the same entity' 错误。当我点击我的数据采集程序上的 'stop generating real time XML data' 按钮时。 xml_smf 文件消失,xml 文件最终更新为结束标记。问题是我需要程序实时读取数据,而不需要现场用户不断地点击数据采集程序上的stop/start按钮。
我的问题如下:
有没有人使用过 XML_SMF 文件?关于它们的用途有什么建议吗?
是否有我可以在 Matlab 中应用的变通方法,以打开 XML 文件并在其后附加正确的结束标记?
对于可以处理实时数据(在 Matlab 中)的工作流程,您有什么建议吗?我正在描绘某种循环,其中每 30 秒左右重新处理越来越大的 XML 文件。
直到文件为well-formed, it's not XML. If its only issue is a missing close tag for the root element, simply read the file as text and write it out with the missing closing tag. (Hopefully you won't also have to contend with the file being held open for writing by another process.) Then read it as XML. If there are more problems, see