469,271 Members | 997 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,271 developers. It's quick & easy.

xpath with big files

Hi,
I've encountered a problem when trying to use lxml.etree.xpath with
big (63Mb) file. It returns empty list on any request.
Is there any restriction on file size for lxml.etree.xpath?

This is what I do:

f=open(filename)
tree = etree.parse(f)
f.close()
r = tree.xpath('//image')
print(r)

it prints:
[]

What is wrong here?
Jun 27 '08 #1
1 1112
Vladimir Kropylev wrote:
I've encountered a problem when trying to use lxml.etree.xpath with
big (63Mb) file. It returns empty list on any request.
Is there any restriction on file size for lxml.etree.xpath?
No.

This is what I do:

f=open(filename)
tree = etree.parse(f)
f.close()
Consider using

tree = etree.parse(filename)

r = tree.xpath('//image')
print(r)

it prints:
[]

What is wrong here?
Does your document use namespaces? In that case, asking for an unnamespaced
"image" will not get you any result.

Stefan
Jun 27 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Phoebian | last post: by
4 posts views Thread by Clarence | last post: by
8 posts views Thread by Terry P | last post: by
4 posts views Thread by Son KwonNam | last post: by
2 posts views Thread by dba123 | last post: by
6 posts views Thread by J.Marsch | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.