Website hosting service by Active-Venture.com
  

 Back to Index


13.12.1 XMLReader Objects

The XMLReader interface supports the following methods:

 

 
parse( source)
Process an input source, producing SAX events. The source object can be a system identifier (a string identifying the input source - typically a file name or an URL), a file-like object, or an InputSource object. When parse() returns, the input is completely processed, and the parser object can be discarded or reset. As a limitation, the current implementation only accepts byte streams; processing of character streams is for further study.

 

 
getContentHandler( )
Return the current ContentHandler.

 

 
setContentHandler( handler)
Set the current ContentHandler. If no ContentHandler is set, content events will be discarded.

 

 
getDTDHandler( )
Return the current DTDHandler.

 

 
setDTDHandler( handler)
Set the current DTDHandler. If no DTDHandler is set, DTD events will be discarded.

 

 
getEntityResolver( )
Return the current EntityResolver.

 

 
setEntityResolver( handler)
Set the current EntityResolver. If no EntityResolver is set, attempts to resolve an external entity will result in opening the system identifier for the entity, and fail if it is not available.

 

 
getErrorHandler( )
Return the current ErrorHandler.

 

 
setErrorHandler( handler)
Set the current error handler. If no ErrorHandler is set, errors will be raised as exceptions, and warnings will be printed.

 

 
setLocale( locale)
Allow an application to set the locale for errors and warnings.

SAX parsers are not required to provide localization for errors and warnings; if they cannot support the requested locale, however, they must throw a SAX exception. Applications may request a locale change in the middle of a parse.

 

 
getFeature( featurename)
Return the current setting for feature featurename. If the feature is not recognized, SAXNotRecognizedException is raised. The well-known featurenames are listed in the module xml.sax.handler.

 

 
setFeature( featurename, value)
Set the featurename to value. If the feature is not recognized, SAXNotRecognizedException is raised. If the feature or its setting is not supported by the parser, SAXNotSupportedException is raised.

 

 
getProperty( propertyname)
Return the current setting for property propertyname. If the property is not recognized, a SAXNotRecognizedException is raised. The well-known propertynames are listed in the module xml.sax.handler.

 

 
setProperty( propertyname, value)
Set the propertyname to value. If the property is not recognized, SAXNotRecognizedException is raised. If the property or its setting is not supported by the parser, SAXNotSupportedException is raised.

 

  

 

2002-2004 Active-Venture.com Webhosting Service

 

Disclaimer: This documentation is provided only for the benefits of our hosting customers.
For authoritative source of the documentation, please refer to http://python.org/doc/

 

Cheap domain registration : Register domain name or buy domain name, including free domain hosting services

 
Active-Domain.com offers cheap domain registration, domain name transfer and domain search services    

Domain registration : Buy domain name or register domain name from $5.95/year only