Example #1
0
    def __init__(self, file):
        """Represents an XML under validation.

        The XML can be retrieved given its filesystem path,
        an URL, a file-object or an etree instance.

        The XML is validated against the JATS Publishing tag set
        and the SPS Style.

        :param file: Path to the XML file, URL or etree.
        """
        if isinstance(file, etree._ElementTree):
            self.lxml = file
        else:
            self.lxml = etree.parse(file)

        self.xmlschema = XMLSchema('SciELO-journalpublishing1.xsd')
        self.schematron = XMLSchematron('sps.sch')
        self.ppl = StyleCheckingPipeline()