3d-dart/server/system/XMLwriter.py
def create(dom):
        """
        Create a Node representation, given either
        a string representation of an XML doc, or a dom.
        """
        if isinstance(dom, str):
            # Strip all extraneous whitespace so that
            # text input is handled consistently:
            dom = re.sub("\s+", " ", dom)
            dom = dom.replace("> ", ">")
            dom = dom.replace(" <", "<")
            return Node.create(parseString(dom))
        if dom.nodeType == dom.DOCUMENT_NODE:
            return Node.create(dom.childNodes[0])
        if dom.nodeName == "#text":
            return
        node = Node(dom.nodeName)
        if dom.attributes:
            for name, val in dom.attributes.items():
                node.setAttribute(name, val)
        for n in dom.childNodes:
            if n.nodeType == n.TEXT_NODE and n.wholeText.strip():
                node.value = n.wholeText
            else:
                subnode = Node.create(n)
                if subnode:
                    node += subnode
        return node

        Create a Node representation, given either
        a string representation of an XML doc, or a dom.
        
Create a Node representation, given either
a string representation of an XML doc, or a dom.
Create a Node representation given either a string representation of an XML doc or a dom .
def create(dom):
        if isinstance(dom, str):
            dom = re.sub("\s+", " ", dom)
            dom = dom.replace("> ", ">")
            dom = dom.replace(" <", "<")
            return Node.create(parseString(dom))
        if dom.nodeType == dom.DOCUMENT_NODE:
            return Node.create(dom.childNodes[0])
        if dom.nodeName == "#text":
            return
        node = Node(dom.nodeName)
        if dom.attributes:
            for name, val in dom.attributes.items():
                node.setAttribute(name, val)
        for n in dom.childNodes:
            if n.nodeType == n.TEXT_NODE and n.wholeText.strip():
                node.value = n.wholeText
            else:
                subnode = Node.create(n)
                if subnode:
                    node += subnode
        return node
def create ( dom ) : if isinstance ( dom , str ) : dom = re . sub ( "\s+" , " " , dom ) dom = dom . replace ( "> " , ">" ) dom = dom . replace ( " <" , "<" ) return Node . create ( parseString ( dom ) ) if dom . nodeType == dom . DOCUMENT_NODE : return Node . create ( dom . childNodes [ 0 ] ) if dom . nodeName == "#text" : return node = Node ( dom . nodeName ) if dom . attributes : for name , val in dom . attributes . items ( ) : node . setAttribute ( name , val ) for n in dom . childNodes : if n . nodeType == n . TEXT_NODE and n . wholeText . strip ( ) : node . value = n . wholeText else : subnode = Node . create ( n ) if subnode : node += subnode return node
Create a Node representation, given either
a string representation of an XML doc, or a dom.
Create a Node representation given either a string representation of an XML doc or a dom .
"""
        Create a Node representation, given either
        a string representation of an XML doc, or a dom.
        """ # Strip all extraneous whitespace so that # text input is handled consistently:
dom