Package Bio :: Package EUtils :: Module POM
[hide private]
[frames] | no frames]

Module POM

source code

This module implements the XML POM -- the Python Object Model for XML. It is something like DOM, but more Python-ic, and easier to use. These base classes are used to build POM source files which are self-validating python-based XML constructor objects. The major parts of the dtd2py command line tool are also here.

Classes [hide private]
  ValidationError
ValidationError This exception is raised when an attempt is made to construct an XML POM tree that would be invalid.
  IndentedText
  Text
  Comment
  ElementNode
  Fragments
Fragments is a special holder class to hold 'loose' markup fragments.
  POMDocument
  ObjectParserHandler
  ContentModel
Represents and validates a content model.
  _ContentModelGenerator
_ContentModelGenerator(rawmodel) The DTD parser generated and final content model are so different that a different content model generator is used for this object.
  Enumeration
  AttributeList
  _AttributeType
  IDREFS
  ENTITIES
  NMTOKENS
  CDATA
  ID
  IDREF
  NMTOKEN
  ENTITY
  PCDATA
  XMLAttribute
  DTDConsumerForSourceGeneration
Functions [hide private]
 
_default_parser_callback(obj) source code
 
get_parser(handlerclass=None, callback=None, module=None) source code
 
get_dtd_compiler(fo, mixinmodule=None, toupper=0) source code
 
IF(test, tv, fv=None) source code
 
get_mod_file(sourcefilename)
Converts a file name into a file name inside the dtds package.
source code
 
_find_element(elname, modules) source code
 
_construct_node(name, modules) source code
 
make_node(path, modules, value=None)
make_Node(path, modules, [value]) Makes a node or an XML fragment given a path, element module list, and an optional value.
source code
 
unescape(s) source code
 
escape(s) source code
Variables [hide private]
  True = 1
  False = 0
  ANY = True
  EMPTY = None
hash(x)
  AT_CDATA = 1
  AT_ID = 2
  AT_IDREF = 3
  AT_IDREFS = 4
  AT_ENTITY = 5
  AT_ENTITIES = 6
  AT_NMTOKEN = 7
  AT_NMTOKENS = 8
  REQUIRED = 11
  IMPLIED = 12
  DEFAULT = 13
  FIXED = 14
  _ATTRTYPEMAP = {'CDATA': 1, 'ENTITIES': 6, 'ENTITY': 5, 'ID': ...
  _ATTRCLASSMAP = {1: <class 'Bio.EUtils.POM.CDATA'>, 2: <class ...
  _DEFAULTMAP = {u'#DEFAULT': 13, u'#FIXED': 14, u'#IMPLIED': 12...
  __package__ = 'Bio.EUtils'
Function Details [hide private]

get_mod_file(sourcefilename)

source code 

Converts a file name into a file name inside the dtds package. This file name is the destination for generated python files.


Variables Details [hide private]

_ATTRTYPEMAP

Value:
{'CDATA': 1,
 'ENTITIES': 6,
 'ENTITY': 5,
 'ID': 2,
 'IDREF': 3,
 'IDREFS': 4,
 'NMTOKEN': 7,
 'NMTOKENS': 8}

_ATTRCLASSMAP

Value:
{1: <class 'Bio.EUtils.POM.CDATA'>,
 2: <class 'Bio.EUtils.POM.ID'>,
 3: <class 'Bio.EUtils.POM.IDREF'>,
 4: <class 'Bio.EUtils.POM.IDREFS'>,
 5: <class 'Bio.EUtils.POM.ENTITY'>,
 6: <class 'Bio.EUtils.POM.ENTITIES'>,
 7: <class 'Bio.EUtils.POM.NMTOKEN'>,
 8: <class 'Bio.EUtils.POM.NMTOKENS'>}

_DEFAULTMAP

Value:
{u'#DEFAULT': 13, u'#FIXED': 14, u'#IMPLIED': 12, u'#REQUIRED': 11}