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

editing XML via DOM

Hi,

I'm new to Python and XML but still I want to create something that
includes creating and editing XML using Python.

Now I'm looking for a little example program that does (some of) this to
set me on my way.

Is there something like this available or can somebody give me some
example lines that creates and saves some XML data?

Cheers,
Jaco
Jul 18 '05 #1
2 1340
On Mon, 20 Dec 2004 21:45:14 +0100, jaco <ja**************@hetnet.nl> wrote:
Hi,

I'm new to Python and XML but still I want to create something that
includes creating and editing XML using Python.

Now I'm looking for a little example program that does (some of) this to
set me on my way.

Is there something like this available or can somebody give me some
example lines that creates and saves some XML data?


I use a really forgiving XML library called 'microdom' that resides in
the twisted library. I won't give an example of that - but I do
recommend it if you have a situation where you need to parse crappy
xml.

A quick google comes up with:

http://www.acooke.org/andrew/writing/python-xml.html
which shows how to use xml.dom.ext.reader.Sax.FromXmlFile and then
doing some stuff with createElement, appendChild and
getElementsByTagName.

Regards,
Stephen Thorne
Jul 18 '05 #2

jaco wrote:
Hi,

I'm new to Python and XML but still I want to create something that
includes creating and editing XML using Python.

Now I'm looking for a little example program that does (some of) this to set me on my way.

Is there something like this available or can somebody give me some
example lines that creates and saves some XML data?


Start with:

http://www.xml.com/pub/a/2002/11/13/py-xml.html

then see:

http://www.xml.com/pub/a/2003/10/15/py-xml.html

Overall, there is a lot on DOM throughout the series:

http://www.xml.com/pub/at/24
--
Uche Ogbuji Fourthought, Inc.
http://uche.ogbuji.net http://4Suite.org http://fourthought.com
Use CSS to display XML -
http://www.ibm.com/developerworks/ed...-xmlcss-i.html
Full XML Indexes with Gnosis -
http://www.xml.com/pub/a/2004/12/08/py-xml.html
Be humble, not imperial (in design) -
http://www.adtmag.com/article.asp?id=10286UBL 1.0 -
http://www-106.ibm.com/developerwork...x-think28.html
Use Universal Feed Parser to tame RSS -
http://www.ibm.com/developerworks/xm.../x-tipufp.html
Default and error handling in XSLT lookup tables -
http://www.ibm.com/developerworks/xm...x-tiplook.html
A survey of XML standards -
http://www-106.ibm.com/developerwork...rary/x-stand4/
The State of Python-XML in 2004 -
http://www.xml.com/pub/a/2004/10/13/py-xml.html

Jul 18 '05 #3

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

Similar topics

4
by: Dan Weeb | last post by:
Hi All, I have struggled through this far with help from many of you so thanks. I am stuck again. I am really new to this so don't be harsh :-) There are a few problems. You can run the script...
3
by: Dirk Rudolf | last post by:
I like to announce you the product X2U, avaible under http://www.lumrix.net/x2. X2U is an acronym for "XML to user". Existing XML editors still ignore the fact that users don't want to read XML...
1
by: nospam | last post by:
Amazon wins patent for ordering forms, Collapsing and Maximizing Form Areas.... NAME OF PATENT Method and system for displaying and editing of information # 6,615,226 ...
10
by: David T. Ashley | last post by:
Hi, I'd like to do some basic graphics. For example, if you look at: http://www.marshallaviationcenter.com the banner graphics at the top that apparently used an image editor with some...
2
by: NewBob | last post by:
Since Access automatically highlights all of the text in a text control (I use it to hold data from a memo field) when the control is activated, I've added the following code to put the cursor at...
1
by: AndrewDucker | last post by:
I've just started working with some people that have an odd setup and I'm wondering if someone can point out a better way of doing things (or what I'm doing wrong). They have a base form class,...
3
by: Islamegy | last post by:
When i press btn_save all changed rows in my grid get saved except the last editing row... I want my btn_Save to end editing in the datagrid.. so if user didn't press "enter" after editing last...
3
by: Tina | last post by:
Does anyone know of an asp.net general purpose table editing tool that will allow users to add modify and delete data? Thanks, T
12
by: Thomas Bartkus | last post by:
Does anyone use emacs together with both WordStar key bindings and python mode? I'm afraid that Wordstar editing key commands are burned R/O into my knuckles! I would like to play with emacs...
9
by: pvsundarram | last post by:
hey, i am trying to cancel the keydown event for certain keycodes( for eg:- enter key ).But the cancelling of this event is not happening in firefox. Is there any way to cancel the event in the...
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: 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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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.