Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > editing XML via DOM

Reply
Thread Tools

editing XML via DOM

 
 
jaco
Guest
Posts: n/a
 
      12-20-2004
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
 
Reply With Quote
 
 
 
 
Stephen Thorne
Guest
Posts: n/a
 
      12-21-2004
On Mon, 20 Dec 2004 21:45:14 +0100, 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?


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
 
Reply With Quote
 
 
 
 
Uche Ogbuji
Guest
Posts: n/a
 
      12-24-2004

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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
getNextSibling() never ends? DOM XML nodes (org.w3c.dom) Alan Java 6 10-13-2008 05:48 PM
Replacing _xmlplus.dom.minidom with xml.dom.minidom aine_canby@yahoo.com Python 3 08-03-2007 03:50 PM
Convert an HTML DOM node to XML Document for XSLT in browser via javascript elsigh Javascript 3 07-22-2006 11:46 PM
Are you looking for high quality photo editing and video editing? gwanglu@gmail.com C Programming 0 07-19-2006 12:32 PM
Convert a XML DOM Object to a HTML DOM Object manjunath.d@gmail.com XML 0 09-20-2005 08:16 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57