Back to index

python3.2  3.2.2
Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | Static Private Attributes
xml.dom.xmlbuilder.DOMBuilder Class Reference

List of all members.

Public Member Functions

def __init__
def setFeature
def supportsFeature
def canSetFeature
def getFeature
def parseURI
def parse
def parseWithContext

Static Public Attributes

 entityResolver = None
 errorHandler = None
 filter = None
int ACTION_REPLACE = 1
int ACTION_APPEND_AS_CHILDREN = 2
int ACTION_INSERT_AFTER = 3
int ACTION_INSERT_BEFORE = 4

Private Member Functions

def _get_entityResolver
def _set_entityResolver
def _get_errorHandler
def _set_errorHandler
def _get_filter
def _set_filter
def _parse_bytestream

Private Attributes

 _options

Static Private Attributes

tuple _legal_actions
dictionary _settings

Detailed Description

Definition at line 44 of file xmlbuilder.py.


Constructor & Destructor Documentation

Definition at line 57 of file xmlbuilder.py.

00057 
00058     def __init__(self):
00059         self._options = Options()

Here is the caller graph for this function:


Member Function Documentation

Definition at line 60 of file xmlbuilder.py.

00060 
00061     def _get_entityResolver(self):
        return self.entityResolver

Definition at line 65 of file xmlbuilder.py.

00065 
00066     def _get_errorHandler(self):
        return self.errorHandler

Definition at line 70 of file xmlbuilder.py.

00070 
00071     def _get_filter(self):
        return self.filter
def xml.dom.xmlbuilder.DOMBuilder._parse_bytestream (   self,
  stream,
  options 
) [private]

Definition at line 202 of file xmlbuilder.py.

00202 
00203     def _parse_bytestream(self, stream, options):
00204         import xml.dom.expatbuilder
00205         builder = xml.dom.expatbuilder.makeBuilder(options)
00206         return builder.parseFile(stream)
00207 

Here is the call graph for this function:

Here is the caller graph for this function:

def xml.dom.xmlbuilder.DOMBuilder._set_entityResolver (   self,
  entityResolver 
) [private]

Definition at line 62 of file xmlbuilder.py.

00062 
00063     def _set_entityResolver(self, entityResolver):
00064         self.entityResolver = entityResolver

def xml.dom.xmlbuilder.DOMBuilder._set_errorHandler (   self,
  errorHandler 
) [private]

Definition at line 67 of file xmlbuilder.py.

00067 
00068     def _set_errorHandler(self, errorHandler):
00069         self.errorHandler = errorHandler

def xml.dom.xmlbuilder.DOMBuilder._set_filter (   self,
  filter 
) [private]

Definition at line 72 of file xmlbuilder.py.

00072 
00073     def _set_filter(self, filter):
00074         self.filter = filter

def xml.dom.xmlbuilder.DOMBuilder.canSetFeature (   self,
  name,
  state 
)

Definition at line 92 of file xmlbuilder.py.

00092 
00093     def canSetFeature(self, name, state):
00094         key = (_name_xform(name), state and 1 or 0)
00095         return key in self._settings

Here is the call graph for this function:

def xml.dom.xmlbuilder.DOMBuilder.getFeature (   self,
  name 
)

Definition at line 162 of file xmlbuilder.py.

00162 
00163     def getFeature(self, name):
00164         xname = _name_xform(name)
00165         try:
00166             return getattr(self._options, xname)
00167         except AttributeError:
00168             if name == "infoset":
00169                 options = self._options
00170                 return (options.datatype_normalization
00171                         and options.whitespace_in_element_content
00172                         and options.comments
00173                         and options.charset_overrides_xml_encoding
00174                         and not (options.namespace_declarations
00175                                  or options.validate_if_schema
00176                                  or options.create_entity_ref_nodes
00177                                  or options.entities
00178                                  or options.cdata_sections))
00179             raise xml.dom.NotFoundErr("feature %s not known" % repr(name))

Here is the call graph for this function:

def xml.dom.xmlbuilder.DOMBuilder.parse (   self,
  input 
)

Definition at line 187 of file xmlbuilder.py.

00187 
00188     def parse(self, input):
00189         options = copy.copy(self._options)
00190         options.filter = self.filter
00191         options.errorHandler = self.errorHandler
00192         fp = input.byteStream
00193         if fp is None and options.systemId:
00194             import urllib.request
00195             fp = urllib.request.urlopen(input.systemId)
00196         return self._parse_bytestream(fp, options)

Here is the call graph for this function:

Here is the caller graph for this function:

def xml.dom.xmlbuilder.DOMBuilder.parseURI (   self,
  uri 
)

Definition at line 180 of file xmlbuilder.py.

00180 
00181     def parseURI(self, uri):
00182         if self.entityResolver:
00183             input = self.entityResolver.resolveEntity(None, uri)
00184         else:
00185             input = DOMEntityResolver().resolveEntity(None, uri)
00186         return self.parse(input)

Here is the call graph for this function:

def xml.dom.xmlbuilder.DOMBuilder.parseWithContext (   self,
  input,
  cnode,
  action 
)

Definition at line 197 of file xmlbuilder.py.

00197 
00198     def parseWithContext(self, input, cnode, action):
00199         if action not in self._legal_actions:
00200             raise ValueError("not a legal action")
00201         raise NotImplementedError("Haven't written this yet...")

def xml.dom.xmlbuilder.DOMBuilder.setFeature (   self,
  name,
  state 
)

Definition at line 75 of file xmlbuilder.py.

00075 
00076     def setFeature(self, name, state):
00077         if self.supportsFeature(name):
00078             state = state and 1 or 0
00079             try:
00080                 settings = self._settings[(_name_xform(name), state)]
00081             except KeyError:
00082                 raise xml.dom.NotSupportedErr(
00083                     "unsupported feature: %r" % (name,))
00084             else:
00085                 for name, value in settings:
00086                     setattr(self._options, name, value)
00087         else:
00088             raise xml.dom.NotFoundErr("unknown feature: " + repr(name))

Here is the call graph for this function:

Definition at line 89 of file xmlbuilder.py.

00089 
00090     def supportsFeature(self, name):
00091         return hasattr(self._options, _name_xform(name))

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Initial value:
(ACTION_REPLACE, ACTION_APPEND_AS_CHILDREN,
                      ACTION_INSERT_AFTER, ACTION_INSERT_BEFORE)

Definition at line 54 of file xmlbuilder.py.

Definition at line 58 of file xmlbuilder.py.

Definition at line 101 of file xmlbuilder.py.

Definition at line 50 of file xmlbuilder.py.

Definition at line 51 of file xmlbuilder.py.

Definition at line 52 of file xmlbuilder.py.

Definition at line 49 of file xmlbuilder.py.

Definition at line 45 of file xmlbuilder.py.

Definition at line 46 of file xmlbuilder.py.

Definition at line 47 of file xmlbuilder.py.


The documentation for this class was generated from the following file: