Logo Search packages:      
Sourcecode: zope-parsedxml version File versions

def ParsedXML::TransPubDOMProxy::TransPubWrapper::wrapDOMObj (   self,
  node 
)

Return the appropriate manageable class wrapped around the Node.
We never create Nodes ourselves, only wrap existing ones.
Wrapped node can be single DOM object, a non-DOM object, or a
container that contains only non-DOM objects - DOM objects in
containters aren't wrapped.

Definition at line 105 of file TransPubDOMProxy.py.

00105                               :
        """
        Return the appropriate manageable class wrapped around the Node.
        We never create Nodes ourselves, only wrap existing ones.
        Wrapped node can be single DOM object, a non-DOM object, or a
        container that contains only non-DOM objects - DOM objects in
        containters aren't wrapped.
        """
        from xml.dom import Node
        import types
        if node == None:
            return None
        elif isinstance(node, types.InstanceType) \
             and node.__class__.__name__ == "ChildNodeList": # XXX impl detail
            return TransPubNodeList(node)
        elif isinstance(node, types.InstanceType) \
             and node.__class__.__name__ == "AttributeMap": # XXX impl detail
            return TransPubNamedNodeMap(node)
        elif not hasattr(node, "nodeType"):
            return node                     # not DOM, don't wrap.
        elif node.nodeType == Node.ELEMENT_NODE:
            return TransPubElement(node)
        elif node.nodeType == Node.ATTRIBUTE_NODE:
            return TransPubAttr(node)
        elif node.nodeType == Node.TEXT_NODE:
            return TransPubText(node)
        elif node.nodeType == Node.CDATA_SECTION_NODE:
            return TransPubCDATASection(node)
        elif node.nodeType == Node.ENTITY_REFERENCE_NODE:
            return TransPubEntityReference(node)
        elif node.nodeType == Node.ENTITY_NODE:
            return TransPubEntity(node)
        elif node.nodeType == Node.PROCESSING_INSTRUCTION_NODE:
            return TransPubProcessingInstruction(node)
        elif node.nodeType == Node.COMMENT_NODE:
            return TransPubComment(node)
        elif node.nodeType == Node.DOCUMENT_NODE:
            return TransPubDocument(node)
        elif node.nodeType == Node.DOCUMENT_TYPE_NODE:
            return TransPubDocumentType(node)
        elif node.nodeType == Node.DOCUMENT_FRAGMENT_NODE:
            return TransPubDocumentFragment(node)
        elif node.nodeType == Node.NOTATION_NODE:
            return TransPubNotation(node)
        else:
            raise TypeError


_TRANS_PUB_DOM_PROXY_FEATURES = (


Generated by  Doxygen 1.6.0   Back to index