473,395 Members | 1,969 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,395 software developers and data experts.

Fast and capable XML parser?

I'm looking for some library to parse XML code
much faster than the libs built into Python 2.4
(I'm stuck with 2.4 for quite a while) and I
also need XML Schema validation, and would
appreciate support for e.g. XPath and XInclude.
I also want an API which is more Pythonic than
e.g. a thin wrapper over a C or C++ API.

It should be available on at least Linux,
Solaris and AIX.

Some uses involve parsing lots of (often small)
XML files at reasonable speed, i.e. several
hundred files per second. That means that we
can't use anything like an os.system call to
xmllint for XML Schema validation--it gets too
slow. I also suspect that the standard Python
libs (in Python 2.4 at least) are slower than
we'd like them to be. (Not that it matters if
they don't support XML Schema validation.)

Any suggestions?
Apr 20 '07 #1
3 1980
Magnus Lycka wrote:
I'm looking for some library to parse XML code
much faster than the libs built into Python 2.4
(I'm stuck with 2.4 for quite a while) and I
also need XML Schema validation, and would
appreciate support for e.g. XPath and XInclude.
I also want an API which is more Pythonic than
e.g. a thin wrapper over a C or C++ API.

It should be available on at least Linux,
Solaris and AIX.

Some uses involve parsing lots of (often small)
XML files at reasonable speed, i.e. several
hundred files per second. That means that we
can't use anything like an os.system call to
xmllint for XML Schema validation--it gets too
slow. I also suspect that the standard Python
libs (in Python 2.4 at least) are slower than
we'd like them to be. (Not that it matters if
they don't support XML Schema validation.)

Any suggestions?
I don't know if it meets ALL of your requirements but this might
help:

http://www.reportlab.org/pyrxp.html

-Larry
Apr 20 '07 #2
Magnus Lycka wrote:
I'm looking for some library to parse XML code
much faster than the libs built into Python 2.4
(I'm stuck with 2.4 for quite a while) and I
also need XML Schema validation, and would
appreciate support for e.g. XPath and XInclude.
I also want an API which is more Pythonic than
e.g. a thin wrapper over a C or C++ API.
For a more Pythonic API, you probably want to look at cElementTree which
is now in the Python 2.5 stdlib. You can get it standalone from here:

http://effbot.org/downloads/#cElementTree

This implementation doesn't fully support XSLT, XPath, etc. but lxml
exposes an ElementTree-style API through lxml.etree, and does, I
believe, support many of these other things:

http://codespeak.net/lxml/

I don't know too much about lxml's speed, but since it's a wrapper to
the libxml2 and libxslt libraries, it should be reasonably fast.

STeVe
Apr 20 '07 #3
Larry Bates wrote:
I don't know if it meets ALL of your requirements but this might
help:

http://www.reportlab.org/pyrxp.html
AFAIK, there is no XML Schema support in PyRXP.
This is really bad enough.

GPL is not an option for us, and a commercial
licence is less good than e.g. MIT or LGPL.
(Partly due to the cost, but also because it
causes much more work for me.)

Besides, I'm a bit suspicious concerning the
lack of benchmarks for the Unicode version...

It seems to me that lxml is better in all
aspects.
Apr 20 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: PedroX | last post by:
Hello: I need to parse some large XML files, and save the data in an Access DB. I was using MSXML 2 and ASP, but it turns out to be extremely slow when then XML documents are like 10 mb in...
4
by: rawCoder | last post by:
Hi, Consider a server which receives delimiter based string data from client. It needs to process this data very fast. Now if its built in C++, one obvious idea would be to put the string on...
2
by: qumpus | last post by:
My program right now generates USPS style shipping label using System.Drawing.Graphics. It works fine except that the printer prints really slowly. I want to make my program take advantage of true...
3
by: garth_rockett | last post by:
We need to process a very large amount of delimited variable length ASCII data in files as large as 3-4 gigs. We need a high performance parser for this and as always, we have no money to buy one....
8
by: markus | last post by:
Hi, As I been programming in C I have discovered more and more tools that really helps to speed up the development process when writing programs. Examples of such tools are cscope, cbrowser,...
20
by: GS | last post by:
The stdint.h header definition mentions five integer categories, 1) exact width, eg., int32_t 2) at least as wide as, eg., int_least32_t 3) as fast as possible but at least as wide as, eg.,...
17
by: Thomas Kowalski | last post by:
Hi, I would like to know whether someone knows a library or function that parses a string containing 3 double numbers in the form like xxxx.yyyyyyyyy xxxx.yyyyyyyyy xxxx.yyyyyyyyy really fast....
0
by: Dancorbier | last post by:
uCalc Fast Math Parser 2.95 is now available. This component allows your applications to evaluate math expressions defined at runtime. The two major new enhancements in this version are faster...
10
by: erokar | last post by:
Which tools would you use? I want the interface design to be as easy and fast as possible, all ideology aside. I'm considering either IronPython+Visual Studio or Python+Qt -- but I'm open for other...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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:
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.