Exercises, examples and other material relating to training module P668. This topic is presented on public course Perl for Larger Projects
The Extensible Markup Language (XML) is an important tool in structuring data. This training module covers the two major XML engines that are supported by Perl modules, and teaches you how to program using them. We also cover handling XSLT in Perl.
Related technical and longer articlesUsing LWP to write Web Clients
|Articles and tips on this subject
|Using Perl to read an RSS feed off a web site and extract data - via LWP and XML modules
Perl is excellent glue-ware ... something I was reminded of towards the end of Friday's Perl Programming Course. A delegate asked me how easy it is to grab an XML resource from the web (such as an RSS feed) and extract data from it. Well - you could write the code yourself, or you could use standard ...
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 ...
|Handling 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
| Sample data file used in XML example
| XML sample for xslt1 demo
| XSLT sample for xlst1.pl demo
| Direct use of the Expat module
| Parsing XML through LibXML
| Altering an XML document through LibXML
| Sample RSS data feed (XML data)
| Using XML::Parser to extract information - practical example
| Parsing XML within a cgi script
| Class of XML element handlers
| SAX parser - extracting titles from XML stream
| Using XML::Parser to transfer an XML structure to memory
| Standard cgi handler to collect form data
| Parsing XML - first test program
| Using debug mode to quickly check a document
| Using Subs to report on an XML source
| Illustration of handling a stream
| Converting an XML document into a tree in Perl collection variables
| Alternative - using handlers
| Using XML and XSLT to turn data into a web page
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?.
Availability of handling XML from Perl.
Parsing XML from Perl.
Installing the Expat library and XML::Parser.
The principles of a parser.
Other controls possible for the constructor.
An example with a full set of data.
Putting it together.
Use of the XML::Parser::Expat.
Gnome - an alternative to the Expat library.
Using Gnome to edit XML.
Using XSLT from Perl.
If you are looking for a complete course and not just a information on a single subject, visit our Listing and schedule
Well House Consultants specialise in training courses in
. We run
throughout the UK (and beyond for longer courses), and
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.