fdutils/xml.py
def validate_xml_against_xsd(xml, xsd_file):
    """ Validates that a XML file is valid against a XML Schema file

    :param xml: an ElementTree or a string containing xml data
    :param xsd_file: path to an xsd file

    """
    xsd = ET.XMLSchema(ET.parse(xsd_file))
    try:
        return xsd.validate(xml if isinstance(xml, ET.ElementBase) else ET.fromstring(str(xml)))
    except:
        return False
 Validates that a XML file is valid against a XML Schema file

    :param xml: an ElementTree or a string containing xml data
    :param xsd_file: path to an xsd file

    
Validates that a XML file is valid against a XML Schema file
Validates that a XML file is valid against a XML Schema file
def validate_xml_against_xsd(xml, xsd_file):
    xsd = ET.XMLSchema(ET.parse(xsd_file))
    try:
        return xsd.validate(xml if isinstance(xml, ET.ElementBase) else ET.fromstring(str(xml)))
    except:
        return False
def validate_xml_against_xsd ( xml , xsd_file ) : xsd = ET . XMLSchema ( ET . parse ( xsd_file ) ) try : return xsd . validate ( xml if isinstance ( xml , ET . ElementBase ) else ET . fromstring ( str ( xml ) ) ) except : return False
Validates that a XML file is valid against a XML Schema file
Validates that a XML file is valid against a XML Schema file
""" Validates that a XML file is valid against a XML Schema file

    :param xml: an ElementTree or a string containing xml data
    :param xsd_file: path to an xsd file

    """
xml
an ElementTree or a string containing xml data
an ElementTree or a string containing xml data
xsd_file
path to an xsd file
path to an xsd file