Did I find the right examples for you? yes no

All Samples(2)  |  Call(2)  |  Derive(0)  |  Import(0)
Validate an XML object

:param xml_obj: The XML object to validate
:type xml_obj: etree.Element
:param dtd_str: The dtd to use for the validation
:type dtd_str: str
:return: True. Raise an exception if the XML is not valid
:rtype: bool

        def validate_xml(xml_obj, dtd_str):
    """Validate an XML object

    :param xml_obj: The XML object to validate
    :type xml_obj: etree.Element
    :param dtd_str: The dtd to use for the validation
    :type dtd_str: str
    :return: True. Raise an exception if the XML is not valid
    :rtype: bool
    """
    dtd_obj = etree.DTD(StringIO.StringIO(dtd_str))
    dtd_obj.assertValid(xml_obj)
    return True
        


src/x/m/xmltool-0.3.6.1/xmltool/factory.py   xmltool(Download)
    dtd_str = utils.get_dtd_content(dtd_url, path)
    if validate:
        utils.validate_xml(tree, dtd_str)
 
    dic = dtd_parser.parse(dtd_str=dtd_str)

src/x/m/xmltool-0.3.6.1/xmltool/elements.py   xmltool(Download)
        if validate:
            dtd_str = utils.get_dtd_content(dtd_url, os.path.dirname(filename))
            utils.validate_xml(xml, dtd_str)
 
        doctype = '<!DOCTYPE %(root_tag)s SYSTEM "%(dtd_url)s">' % {