def __init__(self, store, uuid, version, generator): XMLOffFilter.__init__(self, generator, 'ref', 'text', 'binary') self.store = store self.repository = store.repository.view self.uuid = uuid self.version = version self.data = '' self._attrs = []
def endElement(self, tag): if not self.errorOccurred(): attrs = self._attrs.pop() method = getattr(self, tag + 'End', None) if method is not None: try: method(attrs) except Exception: self.saveException() XMLOffFilter.endElement(self, tag)
def startElement(self, tag, attrs): if not self.errorOccurred(): self.data = '' method = getattr(self, tag + 'Start', None) if method is not None: try: method(attrs) except Exception: self.saveException() self._attrs.append(attrs) XMLOffFilter.startElement(self, tag, attrs)
def cdataBlock(self, data): self.data += data XMLOffFilter.cdataBlock(self, data)
def characters(self, data): self.data += data XMLOffFilter.characters(self, data)