Module expatbuilder
Facility to use the Expat parser to load a minidom instance from a
string or file.
This avoids all the overhead of SAX and pulldom to gain
performance.
|
|
|
|
|
| _parse_ns_name(builder,
name) |
|
|
|
|
parse(file,
namespaces=True)
Parse a document, returning the resulting Document node. |
|
|
|
|
parseString(string,
namespaces=True)
Parse a document from a string, returning the resulting Document
node. |
|
|
|
|
parseFragment(file,
context,
namespaces=True)
Parse a fragment of a document, given the context from which it was
originally extracted. |
|
|
|
|
parseFragmentString(string,
context,
namespaces=True)
Parse a fragment of a document from a string, given the context from
which it was originally extracted. |
|
|
|
|
makeBuilder(options)
Create a builder based on an Options object. |
|
|
|
|
TEXT_NODE = 3
|
|
|
CDATA_SECTION_NODE = 4
|
|
|
DOCUMENT_NODE = 9
|
|
|
FILTER_ACCEPT = 1
|
|
|
FILTER_REJECT = 2
|
|
|
FILTER_SKIP = 3
|
|
|
FILTER_INTERRUPT = 4
|
|
|
theDOMImplementation = DOMImplementation()
|
|
|
_typeinfo_map = {'CDATA': <TypeInfo 'cdata'>, 'ENTITIES': <Typ...
|
|
|
_ALLOWED_FILTER_RETURNS = (1, 2, 3)
|
|
|
_FRAGMENT_BUILDER_INTERNAL_SYSTEM_ID = 'http://xml.python.org/...
|
|
|
_FRAGMENT_BUILDER_TEMPLATE = '<!DOCTYPE wrapper\n %s [\n <!E...
|
Imports:
xmlbuilder,
minidom,
Node,
EMPTY_NAMESPACE,
EMPTY_PREFIX,
XMLNS_NAMESPACE,
expat,
_append_child,
_set_attribute_node,
NodeFilter,
NodeList,
EmptyNodeList,
defproperty,
StringTypes
parse(file,
namespaces=True)
|
|
Parse a document, returning the resulting Document node.
'file' may be either a file name or an open file object.
|
parseFragment(file,
context,
namespaces=True)
|
|
Parse a fragment of a document, given the context from which it was
originally extracted. context should be the parent of the node(s) which
are in the fragment.
'file' may be either a file name or an open file object.
|
parseFragmentString(string,
context,
namespaces=True)
|
|
Parse a fragment of a document from a string, given the context from
which it was originally extracted. context should be the parent of the
node(s) which are in the fragment.
|
_typeinfo_map
- Value:
{'CDATA': <TypeInfo 'cdata'>,
'ENTITIES': <TypeInfo 'entities'>,
'ENTITY': <TypeInfo 'entity'>,
'ENUM': <TypeInfo 'enumeration'>,
'ID': <TypeInfo 'id'>,
'IDREF': <TypeInfo 'idref'>,
'IDREFS': <TypeInfo 'idrefs'>,
'NMTOKEN': <TypeInfo 'nmtoken'>,
...
|
|
_FRAGMENT_BUILDER_INTERNAL_SYSTEM_ID
- Value:
'http://xml.python.org/entities/fragment-builder/internal'
|
|
_FRAGMENT_BUILDER_TEMPLATE
- Value:
'''<!DOCTYPE wrapper
%s [
<!ENTITY fragment-builder-internal
SYSTEM "http://xml.python.org/entities/fragment-builder/internal">
%s
]>
<wrapper %s
>&fragment-builder-internal;</wrapper>'''
|
|