Using Python and lxml to validate XML against an external DTD

前端 未结 2 746
闹比i
闹比i 2021-01-06 14:24

I\'m trying to validate an XML file against an external DTD referenced in the doctype tag. Specifically:



        
2条回答
  •  离开以前
    2021-01-06 14:46

    You need to add no_network=False when constructing the parser object. This option is set to True by default.

    From the documentation of parser options at http://lxml.de/parsing.html#parsers:

    no_network - prevent network access when looking up external documents (on by default)

提交回复
热议问题