Quantcast
Channel: Parsing large XML file with lxml - Stack Overflow
Viewing all articles
Browse latest Browse all 3

Parsing large XML file with lxml

$
0
0

I am trying to parse the dblp.xml file(3.2gb) using lxml.The following below is my code.

from lxml import etreefrom io import StringIO, BytesIOtree = etree.parse("dblp.xml")

However I get an error stating :

OSError                                   Traceback (most recent call last)<ipython-input-5-6a342013a160> in <module>      1 from lxml import etree      2 from io import StringIO, BytesIO----> 3 tree = etree.parse("dblp.xml")src/lxml/etree.pyx in lxml.etree.parse()src/lxml/parser.pxi in lxml.etree._parseDocument()src/lxml/parser.pxi in lxml.etree._parseDocumentFromURL()src/lxml/parser.pxi in lxml.etree._parseDocFromFile()src/lxml/parser.pxi in lxml.etree._BaseParser._parseDocFromFile()src/lxml/parser.pxi in lxml.etree._ParserContext._handleParseResultDoc()src/lxml/parser.pxi in lxml.etree._handleParseResult()src/lxml/parser.pxi in lxml.etree._raiseParseError()OSError: Error reading file 'dblp.xml': failed to load external entity "dblp.xml"

Both dblp.xml and dblp.dtd is in the root folder already.

Please help!


Viewing all articles
Browse latest Browse all 3

Latest Images

Trending Articles





Latest Images