473,729 Members | 2,042 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1369
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.rea der.Sax.FromXml File and then
doing some stuff with createElement, appendChild and
getElementsByTa gName.

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
2401
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 here http://www.pbrown.com/research/test1.php to see the formatting issues Formatting Issues
3
2433
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 markup. Our view is: Not users have to align to XML, but XML has to align to users. X2U allows users tp fill out simple web forms, which are automatically derived from XML models. The XML model provides the XML structure and an interface...
1
1876
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 http://tinyurl.com/m7v8 **** CLAIM #10 ****
10
1942
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 fonts built in and the way the airplane pictures are faded around the edges.
2
4263
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 the end. Private Sub txtCapability_GotFocus() ‘ Placed either behind the OnEnter or GotFocus Event of a control named, ' in this case, txtCapability, on a form ensures that when the control is
1
1991
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, derived from the standard Form, but with the ability to show a list of panels in order. Each of these panels is a subclass of a subclass of Panel. The initial subclass is tweaked to work with the special form and then each subclass of that is...
3
3826
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 cell of the current row, I could force this row to be saved in the datasource. help plz
3
1795
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
2827
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 for Python editing but I'm having (2) problems. 1) When I load a .py file, emacs automatically overrides my wordstar-mode with python-mode, forcing all the keybindings back to emacs native keys. Why?
9
4074
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 iframe. CODE ===== <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en_US"
0
8766
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9291
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9217
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9158
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6722
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6026
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4535
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3244
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2698
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.