473,386 Members | 1,698 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 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 1201
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Phoebian | last post by:
Hi all, Here is a little concept problem, and I need some guideline. I am currently developing a application which delivers XML files. I want then to sequentially perform some actions on...
4
by: Clarence | last post by:
Hi - I have a problem and here is the verbose version of what I am trying to do (better too much info than not enough). I am searching through about 4,700 XML files containing company contact...
8
by: Terry P | last post by:
Are there any tools (java classes, tag libraries) which can translate xpath statements into a SQL query? Given an xpath query which has a predicate that filters node values or attributes, I want...
4
by: Son KwonNam | last post by:
In XSLT, is this possible to get value from xml using XPath which is in XSLT variable? I mean XPath strings can be dynamic while XSL Transforming. If possible, How?? Because I'm not a...
3
by: werD | last post by:
Hello I have an xml document that im currently using a forward only .net repeater on and using some xpath queries to display the data The xml is quite simple <?xml version="1.0"...
2
by: dba123 | last post by:
I have an issue where I want to put an image right before the text for each record below in a GridView. The problem is, the XPath is rss/channel/item". So since I have the picture in my XML file...
2
by: Bilal | last post by:
Hello, I'm stuck on this problem for quite some time and hope somebody would be able to guide me. Basically, I need to populate a large number of "template" XML files which have all...
6
by: J.Marsch | last post by:
I must be completely losing my mind. I have some code that writes to config files. It works great with app.config files, but fails miserably with web.config files. For the life of me, I cannot...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.