Lxml - errog_log 与 XML 工具之间的差异
我和我的团队经常使用 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论