You are here:   » Home » Documentation » Details » How-To » Import/Export/XML » XML with DTML

DTML-based XML-export (without XSL)

Author: Dr. Thorsten Fox, 2006/02/15

For generating simple, manageable XML-structures the Python-String operations and DTML offer a possibility to generate this without XSL-transformations and filters. The presented DTML-method "feed.xml" and further scripts constitute a basic concept for generating XML-data from ZMS.

Zoom (66KB)

The XML-export of the site is initiated by calling feed.xml.

Conceptual approach is the re-implementation of the ZMS objects´rendering routines by access to the basic attributes and arrangement in an own XML-tag structure.

The basic set of the exemplary code consists of the following DTML-methods:

feed.xml[?mode=recursive]
-> renderXMLHeader
-> renderPage
    • renderZMSTextarea
    • renderZMSGraphic
    • renderZMSTable
    • renderZMSCustom_flash-asset4

The main function feed.xml calls both methods renderXMLHeader and render Page, which then renders the individual ZMS objects by means of further methods for each object. In the exemplary code there are methods for ZMSTextarea, Zymographic, ZMSTable as well as a special object "Flash-Asset". render Page processes also embedded links to these objects.

The parameter "?mode=recursive" lists all objects below the calling node recursively in an XML-stream.

Use of the exemplary code: Import the XML file in ZMS on ZOPE level and relocate the methods set to the highest level.

Pre-requisite: XHMTL conformity of objects and contents. This should be checked in advance through action "checkXHTMLconformity".

Print this Document   change language   Sitemap   Contact