Home Accessibility Courses Twitter The Mouth Facebook Resources Site Map About Us Contact

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, Intermediate Python

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.

Articles and tips on this subjectupdated
4710Searching a Json or XML structure for a specific key / value pair in Python
With data loaded from JSon or XML structures, you'll often want to search for attributes by element name - without having to code the structure, and with the code adapting itself to mean subtle structure changes in the suppied data. Here's an example written during lat week's tailored Intermediate Python ...
4594XML handling in Python - a new teaching example using etree
From the Python course just completed - a new example of XML handling, through the xml.etree.ElementTree module which was first available in Python 2.5.   import xml.etree.ElementTree as etree   try:     tree = etree.parse(args.sourcefile[0])   except ...
3082XML handling in Python - SAX, DOM and XSLT examples
XML is the "eXtensible Markup Language" ... a set of rules to which a language must adhere, rather than a complete language definition - you need to add other elements such as a DTD or Schema to complete the definition of a language that conforms to an XML standard. How do you process XML, then? There ...
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 and pointing any visitors at replacements. There' been a lot of that going on over the last couple of days ... for example: 1. I have deleted two ...
2506Good example of recursion in Python - analyse an RSS feed
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 are, however, exceptions where I say "THAT is a good use of recursion". Once such is in the handling / parsing of RSS (Really Simple Syndication) feeds. I ...
2378Handling XML in Perl - introduction and early examples
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 (and in some cases writing) XML streams. (definition of XML: Extended Markup Language - a tagging system in plain text for marking up data; not ...
Examples from our training material
image.xsl   xslt program for Python / xslt / xml demo
images.xml   XML data used by demonstration program
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
simdom.py   Reading XML into memory structure - DOM
simpull.xml   XML data for simsax and sidom demonstrations
simsax.py   Parsing XML stream for pertinent data - SAX
xmlparserdemo   command line params (argparse) and xml (ElementTree)
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 [here].
Topics covered in this module
What is XML.
XML Handlers.
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 Ruby, Lua, 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.

You can Add a comment or ranking to this page

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

PAGE: http://www.wellho.net/resources/Y151.html • PAGE BUILT: Mon Feb 8 18:55:24 2016 • BUILD SYSTEM: WomanWithCat