Home Accessibility Courses Twitter The Mouth Facebook Resources Site Map About Us Contact
 
For 2023 (and 2024 ...) - we are now fully retired from IT training.
We have made many, many friends over 25 years of teaching about Python, Tcl, Perl, PHP, Lua, Java, C and C++ - and MySQL, Linux and Solaris/SunOS too. Our training notes are now very much out of date, but due to upward compatability most of our examples remain operational and even relevant ad you are welcome to make us if them "as seen" and at your own risk.

Lisa and I (Graham) now live in what was our training centre in Melksham - happy to meet with former delegates here - but do check ahead before coming round. We are far from inactive - rather, enjoying the times that we are retired but still healthy enough in mind and body to be active!

I am also active in many other area and still look after a lot of web sites - you can find an index ((here))

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 ...
2016-10-30
 
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 ...
2015-12-09
 
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 ...
2010-12-10
 
2555Bookkeeping
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 ...
2009-12-29
 
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 ...
2009-11-20
 
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 ...
2009-08-27
 
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.
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 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., 2024: 48 Spa Road • Melksham, Wiltshire • United Kingdom • SN12 7NY
PH: 01144 1225 708225 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho

PAGE: http://www.wellho.net/resources/Y151.html • PAGE BUILT: Sun Oct 11 14:50:09 2020 • BUILD SYSTEM: JelliaJamb