The Exporter

From Apache OpenOffice Wiki
< Documentation‎ | DevGuide
Revision as of 12:28, 3 January 2021 by DiGro (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search



Evaluating XExportFilter Parameters

The exporter() method operates in much the same way as importer(), except that instead of the exporter using a provided XDocumentHandler, it is itself a com.sun.star.xml.sax.XDocumentHandler implementation.

When the exporter() method is invoked, the necessary variables need to be extracted for use by the filter. This is the same thing that happens with the importer, except that the MediaDescriptor contains an XOutputStream, instead of the importer's XInputStream. Once the variables have been extracted (and - in some cases - a Pipe has been created) the exporter() method returns. It does not carry out the filtering at this stage.

Documentation note.png The pipe is only necessary if the output needs to be processed further after being processed by the XDocumentHandler. Otherwise, the result from the XDocumentHandler implementation can be written directly to the XOutputStream provided. For instance, this is the case with a FlatXML filter.

Exporter Filtering

After the exporter() method returns, the XML filter adapter then invokes the com.sun.star.xml.sax.XDocumentHandler methods to parse the XML output.

For the filtering, the com.sun.star.xml.sax.XDocumentHandler implementation is used. This consists of a set of SAX event handling methods, which define how particular XML tags are handled. These methods are:

  startDocument(){
  }
  endDocument(){
  }
  startElement(){
  }
  endElement(){
  }
  charactors(){
  }
  ignorableWhitespace(){
  }
  processingInstruction(){
  }
  setDocumentLocator(){
  }

The result of this event handling can be processed and written to the XOutputStream that was extracted from the MediaDescriptor.

Content on this page is licensed under the Public Documentation License (PDL).
Personal tools
In other languages