@classmethod
    def validate_xml_node(cls,node):
        """Check that the given xml node is valid for this object.

        Here 'valid' means that it is the right tag, in the right
        namespace.  We might add more eventually...
        """
        if node.nodeType != node.ELEMENT_NODE:
            err = "Class '%s' got a non-element node"
            err = err % (cls.__name__,)
            raise ParseError(err)
        if cls.meta.case_sensitive:
            if node.localName != cls.meta.tagname:
                err = "Class '%s' got tag '%s' (expected '%s')"
                err = err % (cls.__name__,node.localName,
                             cls.meta.tagname)
                raise ParseError(err)
        else:
            if node.localName.lower() != cls.meta.tagname.lower():
                err = "Class '%s' got tag '%s' (expected '%s')"
                err = err % (cls.__name__,node.localName,
                             cls.meta.tagname)
                raise ParseError(err)
        if cls.meta.namespace:
            if node.namespaceURI != cls.meta.namespace:
                err = "Class '%s' got namespace '%s' (expected '%s')"
                err = err % (cls.__name__,node.namespaceURI,
                             cls.meta.namespace)
                raise ParseError(err)
        else:
            if node.namespaceURI:
                err = "Class '%s' got namespace '%s' (expected no namespace)"
                err = err - (cls.__name__,node.namespaceURI,)
                raise ParseError(err)
dataset/ETHPy150Open rfk/dexml/dexml/__init__.py/Model.validate_xml_node/operator `%` -> `-`