Lxml - errog_log 与 XML 工具之间的差异

发布于 2025-01-10 01:08:50 字数 1075 浏览 2 评论 0原文

我和我的团队经常使用 XML 工具和记事本来打开 xml 文件并使用 XSD 文件对其进行验证。我们有数百个 xml 文件,因此为了加快速度,我使用 lxml 编写了一个 python 脚本。

但是,对于相同的 xml 和 xsd 文件,我在 Lxml 和 XML Tools 之间的 errog_log 中没有相同的结果

当我使用 XML Tools 进行验证时,我会弹出一个窗口,打印以下内容:

ERROR: Element '{http://www.cnav.fr/n4ds}S10_G00_00_005': [facet 'enumeration'] The value '3' is not an element of the set {'02'}.
ERROR: Element '{http://www.cnav.fr/n4ds}S10_G00_00_005': '3' is not a valid value of the local atomic type.
ERROR: Element '{http://www.cnav.fr/n4ds}S20_G00_05_005': '2020-AA-01' is not a valid value of the local atomic type.

当我使用 lxml 时,我的控制台上有这个:

ERROR: Element '{http://www.cnav.fr/n4ds}S10_G00_00_005': [facet 'enumeration'] The value '3' is not an element of the set {'02'}.
ERROR: Element '{http://www.cnav.fr/n4ds}S20_G00_05_005': '2020-AA-01' is not a valid value of the local atomic type.

我想知道日志的差异来自哪里。

PS:我有lxml 4.7.1.0,它使用libxml 2.9.10和libxslt 1.1.34, 记事本上的 XML Tools 2.4.9.2 Unicode 64 位,它使用 libxml 2.9.3 和 libxslt 1.1.28

致以诚挚的问候。

My teams and I are often using XML Tool with Notepad to open the xml file and validate it with an XSD file. We have hundreds of xml file so to make it faster, I wrote a python script using lxml.

However, for the same xml and xsd files, I don't have the same result in the errog_log between Lxml and XML Tools

When I validate with XML Tools , I get a pop-up, printing this :

ERROR: Element '{http://www.cnav.fr/n4ds}S10_G00_00_005': [facet 'enumeration'] The value '3' is not an element of the set {'02'}.
ERROR: Element '{http://www.cnav.fr/n4ds}S10_G00_00_005': '3' is not a valid value of the local atomic type.
ERROR: Element '{http://www.cnav.fr/n4ds}S20_G00_05_005': '2020-AA-01' is not a valid value of the local atomic type.

And when I'm using lxml, I have this on my console :

ERROR: Element '{http://www.cnav.fr/n4ds}S10_G00_00_005': [facet 'enumeration'] The value '3' is not an element of the set {'02'}.
ERROR: Element '{http://www.cnav.fr/n4ds}S20_G00_05_005': '2020-AA-01' is not a valid value of the local atomic type.

I would like to know from where difference in logs come from.

PS : I have lxml 4.7.1.0, which is using libxml 2.9.10 and libxslt 1.1.34,
and XML Tools 2.4.9.2 Unicode 64 bit on Notepad, which is using libxml 2.9.3 and libxslt 1.1.28

Best regards.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文