[XML-SIG] Getting Started

Martin v. Loewis martin@v.loewis.de
Sun, 18 Nov 2001 03:57:17 +0100


> Right, that's what I'm doing at the moment. It just feels awkward to
> use a parser for reading, and then "hand-write" back new and
> modified data.

I cannot see anything awkward with that. You use a parser because
properly parsing XML is difficult. You use print statements to
generate XML because that is very easy. XML is not symmetric in this
respect, and your program should reflect that.

> >2. Have something emit SAX events, and use a SAX XML writer.
>
> The hard part is probably to find out how to send these events and
> where to send them to? Can you suggest some reading I can to find
> more about this?

Essentially, you need to understand all four handlers (see Python
library documentation for details), and you need to understand all
events. 

The events are sent by calling methods on a handler, and you send them
to the handlers, there is not more about it.

> Am I right in assuming that in general SAX may be better suited for
> database applications and DOM for document-based apps?

No. In SAX, it is difficult to do queries. In DOM, that is easy -
especially when you have XPath.

Regards,
Martin