SilvaFlexibleXML information

Description

Silva Flexible XML is an extension to Silva that does the following:

  • Provide a new Silva Flexible XML Document content type that can deal with arbitrary XML: validate it using an Relax NG schema, and transform it using an XSLT template.
  • Provide a new Silva Flexible XSLT Report content type that can be used to transform XML coming from arbitrary XML sources to provide a new view on output. An RSS feed for instance can be transformed using XSLT into an XHTML page.
  • Provide a base class that other Silva content objects that store XML can subclass from. Silva Flexible XML Document is also built on top of this base class.

Supported XML specifications

Silva Flexible XML provides support for a number of XML-related specifications:

Technology

Silva Flexible XML is built on these three technologies:

  • Silva - the powerful and user-friendly CMS
  • Five - to glue XML types, XSLT transforms and Relax NG schemas together. This allows easy registration of new types of XML with the system, from Silva Flexible XML or extension products. An example of the latter is SilvaDocBook.
  • lxml - a Pythonic way to exploit the full power of the libxml2 and libxslt libraries. lxml makes integration of the features of libxml2 with Zope a lot easier because there are a lot of potential mistakes (concerning memory management, segfault prevention) one does not have to worry about.

Example

A built-in example is the FeatureSheet type (IFeatureSheetSource). It doesn't have a Relax NG schema, but if you select it as the type of XML Source, you will be able to select the FeatureSheet transformer for the XSLT transform.

Then, for the XML, fill in a featuresheet. An example can be found in SilvaFlexibleXML/tests/demo.fst. Next, publish this version of the object and go to the public view. You should now see the feature sheet displayed as XHTML.

An example extension that uses SilvaFlexibleXML is SilvaDocBook. This integrates a DocBook Relax NG schema and DocBook XSLT stylesheets into SilvaFlexibleXML.