Diazo (software)
   HOME

TheInfoList



OR:

Diazo, previously named xdv, is a general-purpose,
open source Open source is source code that is made freely available for possible modification and redistribution. Products include permission to use the source code, design documents, or content of the product. The open-source model is a decentralized sof ...
website theming tool. It is written in
Python Python may refer to: Snakes * Pythonidae, a family of nonvenomous snakes found in Africa, Asia, and Australia ** ''Python'' (genus), a genus of Pythonidae found in Africa and Asia * Python (mythology), a mythical serpent Computing * Python (pro ...
and generates
XSLT XSLT (Extensible Stylesheet Language Transformations) is a language originally designed for transforming XML documents into other XML documents, or other formats such as HTML for web pages, plain text or XSL Formatting Objects, which may subseque ...
. Diazo creates a separation between theme pages (static HTML) and transformation rules (Diazo's own
domain specific language A domain-specific language (DSL) is a computer language specialized to a particular application domain. This is in contrast to a general-purpose language (GPL), which is broadly applicable across domains. There are a wide variety of DSLs, ranging ...
based in
XML Extensible Markup Language (XML) is a markup language and file format for storing, transmitting, and reconstructing arbitrary data. It defines a set of rules for encoding documents in a format that is both human-readable and machine-readable. T ...
), allowing web designers to work on templates in plain HTML, without knowledge of XSLT or special template-related codes. Diazo creates a themed site by using user-defined rules to combine
vanilla Vanilla is a spice derived from orchids of the genus ''Vanilla (genus), Vanilla'', primarily obtained from pods of the Mexican species, flat-leaved vanilla (''Vanilla planifolia, V. planifolia''). Pollination is required to make the p ...
content from a dynamic website together with a static HTML theme. The rules file (conventionally named rules.xml) has directives which, for example, may replace the contents of an HTML node in the theme with the contents of one in the content.


Web server support

The Diazo compiler generates
XSLT XSLT (Extensible Stylesheet Language Transformations) is a language originally designed for transforming XML documents into other XML documents, or other formats such as HTML for web pages, plain text or XSL Formatting Objects, which may subseque ...
, which can be deployed on any proxying web server with an XSLT processor such as
Apache The Apache () are a group of culturally related Native American tribes in the Southwestern United States, which include the Chiricahua, Jicarilla, Lipan, Mescalero, MimbreƱo, Ndendahe (Bedonkohe or Mogollon and Nednhi or CarrizaleƱo an ...
(using mod_transform),
Varnish Varnish is a clear transparent hard protective coating or film. It is not a stain. It usually has a yellowish shade from the manufacturing process and materials used, but it may also be pigmented as desired, and is sold commercially in various ...
, or
WSGI The Web Server Gateway Interface (WSGI, pronounced ''whiskey'' or ) is a simple calling convention for web servers to forward requests to web applications or frameworks written in the Python programming language. The current version of WSGI, v ...
. WSGI also has more direct Diazo support: the ''DiazoMiddleware'' filter will compile and cache Diazo themes on the fly. Nginx has an XSLT processor, but, as of March 2012, it requires the unthemed website (the content) to use strict XHTML. The strict requirement can be relaxed, however, if a patched version of Nginx is used.Nginx with HTML xslt support
html-xslt on Google code
, patches Nginx 0.7.67 from 15 June 2010


History and naming

Diazo was originally a reimplementation of an earlier software called Deliverance. Where Deliverance would handle the HTML transformation in Python, Diazo generates XSLT which can then be used to defer the actual transformation to faster XSLT engines. The name change to Diazo (from xdv) was announced at the Plone conference 2010. A major motivation for the name change was to reduce ambiguity, as the XDV name was used by both collective.xdv (a
Plone Plone is a free and open source content management system (CMS) built on top of the Zope application server. Plone is positioned as an enterprise CMS and is commonly used for intranets and as part of the web presence of large organizations. High ...
-specific theming package, now called plone.app.theming) and by the stand-alone XDV tools (now called Diazo). Also dv.xdvserver was renamed to DiazoMiddleware. Diazo is based on DVNG, a prototype version of xdv. Diazo originally implemented only a subset of the features in Deliverance, but now has similar features, although their configuration language is not completely compatible. Diazo has become the de facto standard for theming in Plone 4 and is included in Plone 4.2 and later.


Directives

The basic directives of Diazo include: replace (replace a node or attribute in the theme with that from content), before and after (insert a node before or after another), drop (delete a node or attribute), strip (remove a tag but not its child nodes), merge, and copy. A node, node's children or attribute, can be selected with either XPath selectors or CSS3 selectors. CSS selectors are replaced by the equivalent XPath selector during the pre-processing step of the compiler. Advanced features include: conditions based on content nodes or paths, with grouping and nesting; multiple, conditional themes; modifying the theme or content on the fly; inline XSL directives; Doctype changes; XInclude protocol.


References


External links


Diazo.org
- official homepage Web development software