Exemplo n.º 1
0
 def new_cache_document(self):
     """
     Creates a new empty cache document and saves it to disk
     """
     cache_doc = DocumentHelper.createDocument()
     pinfo = ParliamentInfoParams()
     # <cachedTypes />
     cache_doc.addElement(pinfo.CACHED_TYPES)
     self.write_cache_doc_to_file(cache_doc)
Exemplo n.º 2
0
 def xpath(self, query, namespaces=(), **kwargs):
     variables = BrokenVariableContext(kwargs)
     xpathSelector = DocumentHelper.createXPath(query)
     xpathSelector.setNamespaceURIs(dict(namespaces))
     xpathSelector.setVariableContext(variables)
     return [Element(e) for e in xpathSelector.selectNodes(self._elem)]
Exemplo n.º 3
0
def parse_string(text):
    return RootTree(DocumentHelper.parseText(text))