Movatterモバイル変換


[0]ホーム

URL:


Previous PageUp One LevelNext PagePython Library ReferenceContentsModule IndexIndex
Previous:13.12 xml.sax.xmlreaderUp:13.12 xml.sax.xmlreaderNext:13.12.2 IncrementalParser Objects

 
13.12.1 XMLReader Objects

TheXMLReader interface supports the following methods:

parse(source)
Process an input source, producing SAX events. Thesource object can be a system identifier (a string identifying the input source - typically a file name or an URL), a file-like object, or anInputSource object. Whenparse() 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 currentContentHandler.

setContentHandler(handler)
Set the currentContentHandler. If noContentHandler is set, content events will be discarded.

getDTDHandler()
Return the currentDTDHandler.

setDTDHandler(handler)
Set the currentDTDHandler. If noDTDHandler is set, DTD events will be discarded.

getEntityResolver()
Return the currentEntityResolver.

setEntityResolver(handler)
Set the currentEntityResolver. If noEntityResolver 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 currentErrorHandler.

setErrorHandler(handler)
Set the current error handler. If noErrorHandler 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 featurefeaturename. If the feature is not recognized,SAXNotRecognizedException is raised. The well-known featurenames are listed in the modulexml.sax.handler.

setFeature(featurename, value)
Set thefeaturename tovalue. 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 propertypropertyname. If the property is not recognized, aSAXNotRecognizedException is raised. The well-known propertynames are listed in the modulexml.sax.handler.

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


Previous PageUp One LevelNext PagePython Library ReferenceContentsModule IndexIndex
Previous:13.12 xml.sax.xmlreaderUp:13.12 xml.sax.xmlreaderNext:13.12.2 IncrementalParser Objects
Release 2.2.3, documentation updated on 30 May 2003.
SeeAbout this document... for information on suggesting changes.
[8]ページ先頭

©2009-2026 Movatter.jp