Esempio n. 1
0
 def appendChild(self, node):
     
     if node.nodeType == Node.CDATA_SECTION_NODE:
         if len(self.childNodes) == 0:
             BasicSvgNode.appendChild(self, node)
         else:
             raise Exception('only one CDATA node can be present, use the getData and setData to change the data')
     else:
         raise Exception('only CDATA nodes can be added')
Esempio n. 2
0
    def appendChild(self, node):

        if node.nodeType == Node.CDATA_SECTION_NODE:
            if len(self.childNodes) == 0:
                BasicSvgNode.appendChild(self, node)
            else:
                raise Exception(
                    'only one CDATA node can be present, use the getData and setData to change the data'
                )
        else:
            raise Exception('only CDATA nodes can be added')