Thursday 15 August 2013

Python: Parsing XML with lxml -



Python: Parsing XML with lxml -

i trying utilize library called dblp-python. library parses dblp info (which in xml format). while trying print publications of author, script acts weirdly. prints them without errors, , shows error. if run same code more 1 time after error, shows publications without problem. code utilize is:

a = dblp.search('michael l. littman') in range(len(a[0].publications)): print print a[0].publications[i].title

the error when execute above code is:

> traceback (mostrecent phone call last): file "<pyshell#217>", line 3, in <module> > print a[0].publications[i].title file "build\bdist.win32\egg\dblp\__init__.py", line 19, in __getattr__ > self.load_data() file "build\bdist.win32\egg\dblp\__init__.py", line 110, in load_data > root = etree.fromstring(xml) file "lxml.etree.pyx", line 3092, in lxml.etree.fromstring (src\lxml\lxml.etree.c:70691) file > "parser.pxi", line 1828, in lxml.etree._parsememorydocument > (src\lxml\lxml.etree.c:106689) file "parser.pxi", line 1716, in > lxml.etree._parsedoc (src\lxml\lxml.etree.c:105478) file > "parser.pxi", line 1086, in lxml.etree._baseparser._parsedoc > (src\lxml\lxml.etree.c:100105) file "parser.pxi", line 580, in > lxml.etree._parsercontext._handleparseresultdoc > (src\lxml\lxml.etree.c:94543) file "parser.pxi", line 690, in > lxml.etree._handleparseresult (src\lxml\lxml.etree.c:96003) file > "parser.pxi", line 620, in lxml.etree._raiseparseerror > (src\lxml\lxml.etree.c:95050) xmlsyntaxerror: space required after > public identifier, line 2, column 47

the code of library can seen here. raised problem author without response. hope of can help me here @ to the lowest degree know error might be. give thanks you

python xml parsing xml-parsing lxml

No comments:

Post a Comment