XML How-To

Martin von Loewis loewis at informatik.hu-berlin.de
Thu May 31 13:23:28 EDT 2001


vdanovich at empireone.net (Vyacheslav Danovich) writes:

> When using xml.sax module and the following file is given:
> 
> <collection>
>   <comic title="Sandman" number='62'>
>     <writer>Neil Gaiman</writer>
>     <penciller pages='1-9,18-24'>Glyn Dillon</penciller>
>     <penciller pages="10-17">Charles Vess</penciller>
>   </comic>
> </collection>
> 
> and I know the title and the number of the 'comic'
> How can I find out the value for <writer>?

You need to implement the startElement, endElement, and characters
methods of a ContentHandler object. See the XML Howto, in particular

http://py-howto.sourceforge.net/xml-howto/node9.html

for details. If you have any specific questions, don't hesitate to ask.

Regards,
Martin




More information about the Python-list mailing list