Home Accessibility Courses Diary The Mouth Forum Resources Site Map About Us Contact

Tips and short articles on this subject
Bookkeeping
Good example of recursion in Python - analyse an RSS feed
Handling XML in Perl - introduction and early examples
Well House Consultants
You are on the site of Well House Consultants who provide Open Source Training Courses and business hotel accommodation. You are welcome to browse and use our resources subject to our copyright statement and to add in links from your pages to ours.
Other subject areas - resources
Java Resources
Well House Manor Resources
Perl Resources
Python Resources
PHP Resources
Object Orientation and General topics
MySQL Resources
Linux / LAMP / Tomcat Resources
Well House Consultants Resources
Extras Resources
C and C++ Resources
Ruby Resources
Tcl/Tk Resources
Web and Intranet Resources
Python module Y151
Python & XML
Exercises, examples and other material relating to training module Y151. This topic is presented on public courses Learning to program in Python, Python Programming

Python Programming - The fundamentals in depth, and an introduction to applications such as GUI design and Data Munging. This course starts at the fundamentals ...
http://www.wellho.net/course/ypfull.html  [course]
Learning to Program in Python - The fundamentals in depth, and an introduction to applications such as GUI design and Data Munging. This course starts ...
http://www.wellho.net/course/ylfull.html  [course]
There are hundreds of modules (literally) in Perl for handing XML. Some of them are highly specialised, but others are of much more general use in reading ...
http://www.wellho.net/mouth/2378_Han ... mples.html  [short article]
I'm not keen on recursive code - code that calls itself. Very often, such code is elegant in a way, yet so 'clever' that it is hard to follow. There ...
http://www.wellho.net/mouth/2506_Goo ... -feed.html  [short article]
from xml.sax.handler import ContentHandler from xml.sax import make_parser import sys class ImageHandler(ContentHandler): title = "" name = "" ...
http://www.wellho.net/resources/ex.php4?item=y151/sax_xml2.py  [code sample]
It's incredible just how much time bookkeeping takes - small adjustments to the various resources we have, tidying up modules that are no longer relevant ...
http://www.wellho.net/mouth/2555_Bookkeeping.html  [short article]
import xml.dom.minidom def explore_children(nodelist,inset): for subnode in nodelist: if (subnode.nodeType == subnode.ELEMENT_NODE): ...
http://www.wellho.net/resources/ex.php4?item=y151/minid3.py  [code sample]

An XML document is a structured piece of data, held as a piece of text. Python can be used to process XML data, a subject which is covered in this module.

This topic is presented on public courses Learning to program in Python, Python Programming

Examples from our training material
minid1.py   parse and check with minidom
minid2.py   report structure with minidom
minid3.py   Useful extraction with minidom
minid4.py   further extraction including data with minidom
minid5.py   Modifying a document structure with minidom
python_rss   Grabbing an RSS feed in Python
sax_xml1.py   First SAX based xml handler
sax_xml2.py   Extracting information via SAX
sax_xml3.py   Attributes and text extracted via SAX
sax_xml4.py   More sophisticated SAX output example
xsltprocess.py   Process an XML file through an XSLT Stylesheet in Python with libxml2 and libxslt
Background information
Some modules are available for download as a sample of our material or under an Open Training Notes License for free download from http://www.training-notes.co.uk.
Topics covered in this module
What is XML.
XML Handlers.
Sax.
DOM.
Using Python to handle XML via SAX.
Accessing attributes and character data via Python and SAX.
Storing information as you parse with SAX.
Using Python to handle XML via DOM.
Adding in a character handler.
Modifying and saving the model.
4Suite libraries.
The Gnome libraries.
Complete learning
If you are looking for a complete course and not just a information on a single subject, visit our Listing and schedule page.

Well House Consultants specialise in training courses in Python, Perl, PHP, and MySQL. We run Private Courses throughout the UK (and beyond for longer courses), and Public Courses at our training centre in Melksham, Wiltshire, England. It's surprisingly cost effective to come on our public courses - even if you live in a different country or continent to us.

We have a technical library of over 700 books on the subjects on which we teach. These books are available for reference at our training centre. Also available is the Opentalk Forum for discussion of technical questions.


You can Add a comment or ranking to this page

© WELL HOUSE CONSULTANTS LTD., 2010: Well House Manor • 48 Spa Road • Melksham, Wiltshire • United Kingdom • SN12 7NY
PH: 01144 1225 708225 • FAX: 01144 1225 344596 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho