[XML-SIG] SAX2 support

Dieter Maurer dieter at handshake.de
Sat Jan 8 19:36:43 CET 2005


Nico Poppelier wrote at 2005-1-7 19:32 +0100:
>The section on xml.sax.handler in the library reference says: " In 
>addition to these classes, xml.sax.handler provides symbolic constants
>for the feature and property names" and then gives a list of features 
>and properties. The source for xml/sax/xmlreader.py, however, does not 
>implement features and properites, and instead throws an exception when 
>you call e.g. getFeature or setFeature.

The "setFeature" and "getFeature" are methods of the parser
(and apparently not the "xmlreader").

I use them this way:

  from xml.sax import make_parser
  from xml.sax.handler import feature_external_ges
  ...
  parser= make_parser(); parser.setDTDHandler(None)
  parser.setFeature(feature_external_ges,0)


-- 
Dieter


More information about the XML-SIG mailing list