471,887 Members | 1,130 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,887 software developers and data experts.

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 1157
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 zermasroor | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.