Python
  Home arrow Python arrow Page 4 - Parsing XML with SAX and Python
Dev Shed Forums  
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Smartphone Development  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Mobile Linux  
App Generation ROI  
IBM® developerWorks  
Forums Sitemap  
E-Commerce Hosting  
Linux Web Hosting  
Managed Hosting  
Small Business Hosting  
VPS Hosting  
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid  
Request Media Kit
Contact Us  
Site Map  
Privacy Policy  
Support  
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
PYTHON

Parsing XML with SAX and Python
By: Nadia Poulou
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: starstarstarstarstar / 14
    2003-01-21


    Table of Contents:
  • Parsing XML with SAX and Python
  • The xml.sax Package
  • Our SAX Parser
  • Homework
  • Conclusion

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      error-file:tidyout.log Del.ici.ous error-file:tidyout.log Digg
      error-file:tidyout.log Blink error-file:tidyout.log Simpy
      error-file:tidyout.log Google error-file:tidyout.log Spurl
      error-file:tidyout.log Y! MyWeb error-file:tidyout.log Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article

     
     
    ADVERTISEMENT


    Parsing XML with SAX and Python - Homework
    ( Page 4 of 5 )

    Even if your knowledge of XML and Python is not advanced I hope that by now you got an idea on how to implement a simple XML parser in Python. Of course this was just a very simple example to illustrate the possibilities of the xml.sax module of Python.

    Here follow some ideas, based on our example, for further exploration:
    • Try to load the <select> list on our web form dynamically from the XML document; that is to parse the document and to present the player names found as elements of the list.
    • In our example we mentioned nothing about proper XML syntax and similar matters. In production applications things do not always turn out as we would hope. This is why exception handling should always be part of your application. You can try to use one or more exception classes to handle the behaviour of your script as soon as an error occurs, by –for example- showing the appropriate error message.


     
     
    >>> More Python Articles          >>> More By Nadia Poulou
     

       

    PYTHON ARTICLES

    - Tuples and Other Python Object Types
    - The Dictionary Python Object Type
    - String and List Python Object Types
    - Introducing Python Object Types
    - Mobile Programming using PyS60: Advanced UI ...
    - Nested Functions in Python
    - Python Parameters, Functions and Arguments
    - Python Statements and Functions
    - Statements and Iterators in Python
    - Sequences and Sets in Python
    - Python Expressions and Operators
    - Dictionaries, Variables and Statements in Py...
    - Data Types in Python
    - The Python Language
    - SSH with Twisted





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 6 Hosted by Hostway
    Stay green...Green IT