If you need a validating parser, [xmlproc] is currently your only choice in Python.
如果需要验证型语法分析器,[xmlproc]是Python当前唯一的选择。
Unfortunately, the standard Python 2.0 XML package does not contain a validating parser.
不幸的是,标准Python 2.0xml包并不包括验证型语法分析器。
If you have or are planning to use a DTD or schema, you will probably prefer a validating parser.
如果您已经或者正在计划使用DTD或模式,您也许会首选验证解析器。
If you use a validating parser like xmlproc, you can utilize a DTD to verify the dialect of an XML document.
如果您使用象xmlproc这样的验证解析器,您可以利用DTD来验证xml文档的方言。
Finally, you can validate documents with an external validating parser, which I discuss later in this article.
最后,可以使用外部的验证解析器来验证文档,我将在本文的后面介绍。
By contrast, a validating parser referring to the DTD can only verify that these elements are represented as strings.
相反,引用DTD的验证解析器只能检查这些元素是否用字符串表示。
The overhead of this request can make a system unscalable if the validating parser does not cache the schema definitions.
如果确认解析器没有对模式定义进行高速缓存,这种请求的开销会使系统失去可扩展性。
In the past, to revalidate your document once it had been modified you had to save it to a file and read it back with a validating parser.
过去,要在文档修改后对它进行重新验证,必须将它保存为一个文件,再用验证解析器读回去。
Through the schema, a validating parser can verify that the element InvoiceNo is a positive integer and the element ProductID consists of one letter between A and Z followed by six digits.
通过模式,验证解析器可以检查元素InvoiceNo 是否是正整数,元素ProductID 的首字符是否为A到 Z之间的字母,后面为六个阿拉伯数字。
Through the schema, a validating parser can verify that the element InvoiceNo is a positive integer and the element ProductID consists of one letter between A and Z followed by six digits.
通过模式,验证解析器可以检查元素InvoiceNo 是否是正整数,元素ProductID 的首字符是否为A到 Z之间的字母,后面为六个阿拉伯数字。
应用推荐