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)
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)]
def parse_string(text): return RootTree(DocumentHelper.parseText(text))