使用libxml2进行dtd验证 [英] Dtd validation with libxml2
本文介绍了使用libxml2进行dtd验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我如何使用libxml2进行dtd验证? 我正在使用阅读器api阅读我的xml文件. 我有一个外部dtd验证文件. 我如何执行验证本身? 我必须将其转换为xsd吗?
how do i do dtd validation with libxml2? i am reading my xml file using the reader api. i have an external dtd validation file. how do i perform the validation itself? do i have to convert it to xsd?
推荐答案
如果您使用python作为编程语言,请尝试使用lxml.它具有libxml2的内置实现,在XML DTD验证中非常简洁.并且它提供了很多信息,可以帮助调试dtd或xml文件.
If your are using python as your programming language, try using lxml. This has in-built implementation of libxml2 which is pretty neat in XML DTD validation. And it provides a lot of information which can be helpful in debugging the dtd or xml file.
这篇关于使用libxml2进行dtd验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文