table2CSV_ger.gif

[1] Presentation of the filter definition: the process only consists of one single XSL-transformation step; the result format is declared as "text".

table2CSVfilterdef_pre_ger.jpg

[2] Filter definition in detail: the filter here is dedicated to the data table objects for literature, glossary and footnotes. The ZMS administrator gets authorisation for the export.

For the transformation a ZMS-filter is applied consisting of one single process step: per XSL the XML-stream generated by ZMS is converted into a CSV-stream. The corresponding XSL-code processes the list of dictionary elements acc. to the following instruction and line-by-line writes out the values separated by a vertical bar (Download):

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet 
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  version="1.0">
  <xsl:output method="text"/>
  <xsl:template match="//list">
    <xsl:for-each select="item">
      <xsl:apply-templates select="dictionary"/>
      <xsl:text>
</xsl:text>
    </xsl:for-each>
  </xsl:template>
  <xsl:template match="dictionary">
    <xsl:for-each select="item">
      <xsl:value-of select="text()"/>
      <xsl:if test="position() &lt; last()">
        <xsl:text>|</xsl:text>
      </xsl:if>
    </xsl:for-each>
  </xsl:template>
  <!-- suppress unneeded textual content -->
  <xsl:template match="text()"/>
</xsl:stylesheet>
table2CSVbatch_ger.gif

[3] As server-sided batch-process only a general call of the XSL-transformer (here xsltproc) is needed; the XSL-file is transferred to this process with the filter-definition (code see above).

table2CSVexport_ger.gif

[4] Use of the filter on a content node exemplified through a literature data table

table2CSVresult_ger.gif

[5] The output stream is given over directly to the browser. (Alternatively a Zip-file could be generated with another batch-step server-sided and given back.)

Erstellt von: Diez B. Roggisch, Artnology; Dr. F. Hoffmann, SNTL Publishing , erstellt am:  2008/06/27 , zuletzt geändert: 2010/09/22