473,405 Members | 2,354 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,405 software developers and data experts.

Python XML API's that preserve XML comments?


Are there any python XML parsing API's that preserve comments -
preferrably that come with python 2.5.1?

Sep 26 '07 #1
2 1465
Dan Stromberg <ds*************@gmail.comwrites:
Are there any python XML parsing API's that preserve comments
(I think you mean "python XML parsing libraries"; it's the library,
not the API, that preserves comments or not.)

I don't have an answer, but this may help to get more information.
The XML 1.0 specification allows for, but does not require, retention
of comments for access by the application:

2.5 Comments

[Definition: .... an XML processor MAY, but need not, make it
possible for an application to retrieve the text of comments. ...]

<URL:http://www.w3.org/TR/REC-xml/#sec-comments>

--
\ "Demagogue: One who preaches doctrines he knows to be untrue to |
`\ men he knows to be idiots." -- Henry L. Mencken |
_o__) |
Ben Finney
Sep 26 '07 #2
Dan Stromberg wrote:
Are there any python XML parsing API's that preserve comments -
Try lxml.

http://codespeak.net/lxml

preferrably that come with python 2.5.1?
It doesn't come with Python 2.5.1, but it's compatible to ElementTree, which
is part of the stdlib. So you can have a fallback to the stdlib if lxml is not
installed (though this will loose comments then).

Stefan
Sep 26 '07 #3

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

Similar topics

46
by: Jon Perez | last post by:
Can one run a 1.5 .pyc file with the 2.x version interpreters and vice versa? How about running a 2.x .pyc using a 2.y interpreter?
3
by: srijit | last post by:
Hello, Here is an example code of xml writer in Python+PythonNet, Ironpython and Boo. The codes look very similar. Regards, Srijit Python + PythonNet: import CLR
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: 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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.