[XML-SIG] My first xml sax import

Lars Marius Garshol larsga@garshol.priv.no
21 Aug 2000 16:26:18 +0200

* Thomas Gagne
| The tutorial for xmllib shows how to create a document handler class
| and include sample code for the startElement() method, 
| but it doesn't list what other methds are available and their
| arguments (and why should it, it's a tutorial?)  Problem is, the
| library reference for xmllib doesn't list a method called
| startElement().

What tutorial is this? The DocumentHandler is a SAX class, and so
something different from xmllib. The reason why the xmllib library
reference does not show the startElement() method is that it belongs
to SAX and not to xmllib.

If you want a SAX reference you can look here:

<URL: http://www.garshol.priv.no/download/software/saxlib/ >

| I assume there's probably one called endElement() but what do I do
| about the value for the tag?

There is an event called endElement(), but XML does not have a concept
of the value of a tag (or even of an element, which is what I think
you really mean).

Elements have content, which may be a single piece of text or quite a
few other things. If you want the textual content of the element you
must accumulate it yourself using the characters() events.

--Lars M.