June 2000
Intermediate to advanced
556 pages
8h 45m
English
As mentioned at the start of this chapter, one of the big advantages of basing an XML application on SAX is that you can switch from XML parser to XML parser without making code changes.
In the demonstration programs of this chapter, you have seen numerous calls to the make_parser function provided in the saxexts (SAX extensions) module.
CD-ROM reference=10036.txt parser = saxexts.make_parser()
When invoked with no parameters, make_parser will return the first SAX-compliant parser it finds installed. You can specify a parser to use by giving its name as a parameter to the make_parser call. In the example below, James Clark's expat parser is selected.
CD-ROM reference=10037.txt parser = saxexts.make_parser("xml.sax.drivers.drv_pyexpat") ...Read now
Unlock full access