Skip to content

Error attempting to process file with ENTITY #398

Answered by brunato
RS-Credentive asked this question in Q&A
Discussion options

You must be logged in to vote

Hi,
no way for doing this from path/url, because ElementTree does not parse external entities.

With lxml.etree this is also disabled for default:

>>> import lxml.etree as etree
>>> etree.parse('oscal_catalog_metaschema.xml')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "src/lxml/etree.pyx", line 3570, in lxml.etree.parse
  File "src/lxml/parser.pxi", line 1952, in lxml.etree._parseDocument
  File "src/lxml/parser.pxi", line 1978, in lxml.etree._parseDocumentFromURL
  File "src/lxml/parser.pxi", line 1881, in lxml.etree._parseDocFromFile
  File "src/lxml/parser.pxi", line 1200, in lxml.etree._BaseParser._parseDocFromFile
  File "src/lxml/parser.pxi", line…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by brunato
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants