saxutils
 


A library of useful helper classes to the saxlib classes, for the
convenience of application and driver writers.

$Id: saxutils.py,v 1.10 2000/05/31 21:03:01 anonymous Exp $


 Modules
                                                                                                                                                                                                                               
os
saxexts
saxlib
string
sys
types
urllib
urlparse


 Classes
                                                                                                                                                                                                                               
AttributeMap
AttributesImpl
saxlib.ContentHandler
ContentGenerator
DefaultHandler(saxlib.EntityResolver, saxlib.DTDHandler, saxlib.ContentHandler, saxlib.ErrorHandler)
saxlib.DTDHandler
DefaultHandler(saxlib.EntityResolver, saxlib.DTDHandler, saxlib.ContentHandler, saxlib.ErrorHandler)
saxlib.EntityResolver
DefaultHandler(saxlib.EntityResolver, saxlib.DTDHandler, saxlib.ContentHandler, saxlib.ErrorHandler)
saxlib.ErrorHandler
DefaultHandler(saxlib.EntityResolver, saxlib.DTDHandler, saxlib.ContentHandler, saxlib.ErrorHandler)
ErrorPrinter
ErrorRaiser
EventBroadcaster
saxlib.HandlerBase(saxlib.EntityResolver, saxlib.DTDHandler, saxlib.DocumentHandler, saxlib.ErrorHandler)
Canonizer
ESISDocHandler
saxlib.IncrementalParser(saxlib.XMLReader)
BaseIncrementalParser
Location
saxlib.XMLFilter(saxlib.XMLReader)
XMLFilterImpl
mllib


 class AttributeMap
           *DEPRECATED*

An implementation of AttributeList that takes an (attr,val) hash
and uses it to implement the AttributeList interface.
 
                                                                                                                                                                                                                     
__getitem__(self, key)
no doc string
__init__(self, map)
no doc string
__len__(self)
no doc string
copy(self)
no doc string
get(self, key, alternative=None)
no doc string
getLength(self)
no doc string
getName(self, i)
no doc string
getType(self, i)
no doc string
getValue(self, i)
no doc string
has_key(self, key)
no doc string
items(self)
no doc string
keys(self)
no doc string
values(self)
no doc string


 class AttributesImpl
           A default implementation of the Attributes interface that wraps two
dictionaries: one mapping attribute names to values and one mapping
qualified names to attribute names.
 
                                                                                                                                                                                                                     
__getitem__(self, name)
no doc string
__init__(self, attrs, rawnames)
no doc string
__len__(self)
no doc string
copy(self)
no doc string
get(self, name, alternative=None)
no doc string
getLength(self)
no doc string
getNameByQName(self, name)
no doc string
getNames(self)
no doc string
getQNames(self)
no doc string
getType(self, name)
no doc string
getValue(self, name)
no doc string
getValueByQName(self, name)
no doc string
has_key(self, name)
no doc string
items(self)
no doc string
keys(self)
no doc string
values(self)
no doc string


 class BaseIncrementalParser(saxlib.IncrementalParser)
           This class implements the parse method of the XMLReader
interface using the feed, close and reset methods of the
IncrementalParser interface as a convenience to SAX 2.0 driver
writers.
 
                                                                                                                                                                                                                     
parse(self, source)
no doc string
prepareParser(self, source)
This method is called by the parse implementation to allow
the SAX 2.0 driver to prepare itself for parsing. The source
argument holds a fully resolved InputSource object.


 class Canonizer(saxlib.HandlerBase)
           *DEPRECATED*

A SAX document handler that produces canonized XML output.
 
                                                                                                                                                                                                                     
__init__(self, writer=<open file '<stdout>', mode 'w' at 762890>)
no doc string
characters(self, data, start_ix, length)
no doc string
endElement(self, name)
no doc string
ignorableWhitespace(self, data, start_ix, length)
no doc string
processingInstruction(self, target, remainder)
no doc string
startElement(self, name, amap)
no doc string
write_data(self, data)
Writes datachars to writer.


 class ContentGenerator(saxlib.ContentHandler)
           ContentHandler implementation that produces XML output.
 
                                                                                                                                                                                                                     
__init__(self, out=<open file '<stdout>', mode 'w' at 762890>)
no doc string
characters(self, content)
no doc string
endElement(self, name, rawname)
no doc string
endPrefixMapping(self, prefix)
no doc string
ignorableWhitespace(self, content)
no doc string
processingInstruction(self, target, data)
no doc string
startDocument(self)
ContentHandler methods
startElement(self, name, rawname, attrs)
no doc string
startPrefixMapping(self, prefix, uri)
no doc string


 class DefaultHandler(saxlib.EntityResolver, saxlib.DTDHandler, saxlib.ContentHandler, saxlib.ErrorHandler)
           Default base class for SAX2 event handlers. Implements empty
methods for all callback methods, which can be overridden by
application implementors. Replaces the deprecated SAX1 HandlerBase
class.
 
                                                                                                                                                                                                                     


 class ESISDocHandler(saxlib.HandlerBase)
           *DEPRECATED*

A SAX document handler that produces naive ESIS output.
 
                                                                                                                                                                                                                     
__init__(self, writer=<open file '<stdout>', mode 'w' at 762890>)
no doc string
characters(self, data, start_ix, length)
Receive an event signalling that character data has been found.
endElement(self, name)
Receive an event signalling the end of an element.
processingInstruction(self, target, remainder)
Receive an event signalling that a processing instruction
has been found.
startElement(self, name, amap)
Receive an event signalling the start of an element.


 class ErrorPrinter
           A simple class that just prints error messages to standard out.
 
                                                                                                                                                                                                                     
__getpos(self, exception)
no doc string
__init__(self, level=0, outfile=<open file '<stderr>', mode 'w' at 7628f0>)
no doc string
error(self, exception)
no doc string
fatalError(self, exception)
no doc string
warning(self, exception)
no doc string


 class ErrorRaiser
           A simple class that just raises the exceptions it is passed.
 
                                                                                                                                                                                                                     
__init__(self, level=0)
no doc string
error(self, exception)
no doc string
fatalError(self, exception)
no doc string
warning(self, exception)
no doc string


 class EventBroadcaster
           *DEPRECATED*

Takes a list of objects and forwards any method calls received
to all objects in the list. The attribute list holds the list and
can freely be modified by clients.
 
                                                                                                                                                                                                                     
__getattr__(self, name)
no doc string
__init__(self, list)
no doc string
__repr__(self)
no doc string


 class Location
           Represents a location in an XML entity. Initialized by being passed
a locator, from which it reads off the current location, which is then
stored internally.
 
                                                                                                                                                                                                                     
__init__(self, locator)
no doc string
getColumnNumber(self)
no doc string
getLineNumber(self)
no doc string
getPublicId(self)
no doc string
getSystemId(self)
no doc string


 class XMLFilterImpl(saxlib.XMLFilter)
           This class is designed to sit between an XMLReader and the
client application's event handlers.  By default, it does nothing
but pass requests up to the reader and events on to the handlers
unmodified, but subclasses can override specific methods to modify
the event stream or the configuration requests as they pass
through.
 
                                                                                                                                                                                                                     
characters(self, content)
no doc string
endDocument(self)
no doc string
endElement(self, name, qname)
no doc string
endPrefixMapping(self, prefix)
no doc string
error(self, exception)
ErrorHandler methods
fatalError(self, exception)
no doc string
getFeature(self, name)
no doc string
getProperty(self, name)
no doc string
ignorableWhitespace(self, chars, start, end)
no doc string
notationDecl(self, name, publicId, systemId)
DTDHandler methods
parse(self, source)
# XMLReader methods
processingInstruction(self, target, data)
no doc string
resolveEntity(self, publicId, systemId)
EntityResolver methods
setDocumentLocator(self, locator)
ContentHandler methods
setFeature(self, name, state)
no doc string
setLocale(self, locale)
no doc string
setProperty(self, name, value)
no doc string
skippedEntity(self, name)
no doc string
startDocument(self)
no doc string
startElement(self, name, qname, attrs)
no doc string
startPrefixMapping(self, prefix, uri)
no doc string
unparsedEntityDecl(self, name, publicId, systemId, ndata)
no doc string
warning(self, exception)
no doc string


 class mllib
           *DEPRECATED*

A re-implementation of the htmllib, sgmllib and xmllib interfaces as a
SAX DocumentHandler.
 
                                                                                                                                                                                                                     
__init__(self)
no doc string
close(self)
no doc string
feed(self, data)
no doc string
get_stack(self)
no doc string
handle_data(self, data)
no doc string
handle_endtag(self, name, method)
no doc string
handle_proc(self, target, data)
no doc string
handle_starttag(self, name, method, atts)
# --- Handler methods (to be overridden)
reset(self)
no doc string
syntax_error(self, message)
no doc string
unknown_endtag(self, name)
no doc string
unknown_starttag(self, name, atts)
no doc string


 Functions
                                                                                                                                                                                                                               
prepare_input_source(source, base='')
This function takes a saxlib.InputSource and an optional base URL
and returns a fully resolved saxlib.InputSource object ready for
reading.