Diazo (software)

Last updated
Diazo
Developer(s) Paul Everitt, Laurence Rowe and Martin Aspeli
Stable release
1.1.1 / March 21, 2015;3 years ago (2015-03-21) [1]
Preview release
e917d54922 / May 20, 2015;3 years ago (2015-05-20) [2]
Operating system Cross-platform
Platform Python
License New BSD
Website diazo.org

Diazo, previously named xdv, is a general-purpose, open source website theming tool. It is written in Python and generates XSLT. Diazo creates a separation between theme pages (static HTML) and transformation rules (Diazo's own domain specific language based in XML), allowing web designers to work on templates in plain HTML, without knowledge of XSLT or special template-related codes.

Open-source software software licensed to ensure source code usage rights

Open-source software (OSS) is a type of computer software in which source code is released under a license in which the copyright holder grants users the rights to study, change, and distribute the software to anyone and for any purpose. Open-source software may be developed in a collaborative public manner. Open-source software is a prominent example of open collaboration.

Python is an interpreted, high-level, general-purpose programming language. Created by Guido van Rossum and first released in 1991, Python has a design philosophy that emphasizes code readability, notably using significant whitespace. It provides constructs that enable clear programming on both small and large scales. Van Rossum led the language community until stepping down as leader in July 2018.

XSLT is a language 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 subsequently be converted to other formats, such as PDF, PostScript and PNG. XSLT 1.0 is widely supported in modern web browsers.

Contents

Diazo creates a themed site by using user-defined rules to combine vanilla 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.

Computer software, and sometimes also other computing-related systems like computer hardware or algorithms, are called vanilla when not customized from their original form, meaning that they are used without any customizations or updates applied to them. Vanilla software has become a widespread de facto industry standard, widely used by businesses and individuals. The term comes from the traditional standard flavor of ice cream, vanilla. According to Eric S. Raymond's The New Hacker's Dictionary, "vanilla" means more "default" than "ordinary".

Web server support

The Diazo compiler generates XSLT, which can be deployed on any proxying web server with an XSLT processor such as Apache (using mod_transform), Varnish, or WSGI.

The Apache HTTP Server, colloquially called Apache, is free and open-source cross-platform web server software, released under the terms of Apache License 2.0. Apache is developed and maintained by an open community of developers under the auspices of the Apache Software Foundation.

Varnish is an HTTP accelerator designed for content-heavy dynamic web sites as well as APIs. In contrast to other web accelerators, such as Squid, which began life as a client-side cache, or Apache and nginx, which are primarily origin servers, Varnish was designed as an HTTP accelerator. Varnish is focused exclusively on HTTP, unlike other proxy servers that often support FTP, SMTP and other network protocols.

The Web Server Gateway Interface (WSGI) 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, version 1.0.1, is specified in Python Enhancement Proposal (PEP) 3333.

WSGI also has more direct Diazo support: the DiazoMiddleware filter will compile and cache Diazo themes on the fly.

Nginx has an XSLT processor, [3] 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. [4] [5]

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-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.

Plone (software)

Plone is a free and open source content management system 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-profile public sector users include the U.S. Federal Bureau of Investigation, Brazilian Government, United Nations, City of Bern (Switzerland), New South Wales Government (Australia), and European Environment Agency. Plone's proponents cite its security track record and its accessibility as reasons to choose Plone.

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.

Related Research Articles

XML Markup language developed by the W3C for encoding of data

Extensible Markup Language (XML) is a markup language that defines a set of rules for encoding documents in a format that is both human-readable and machine-readable. The W3C's XML 1.0 Specification and several other related specifications—all of them free open standards—define XML.

In computing, the Java API for XML Processing, or JAXP, one of the Java XML Application programming interfaces (API)s, provides the capability of validating and parsing XML documents. It has three basic parsing interfaces:

XSL-FO is a markup language for XML document formatting that is most often used to generate PDF files. XSL-FO is part of XSL, a set of W3C technologies designed for the transformation and formatting of XML data. The other parts of XSL are XSLT and XPath. Version 1.1 of XSL-FO was published in 2006.

Saxon is an XSLT and XQuery processor created by Michael Kay and now developed and maintained by his company, Saxonica. There are open-source and also closed-source commercial versions. Versions exist for Java, JavaScript and .NET.

Apache Cocoon, usually just called Cocoon, is a web application framework built around the concepts of pipeline, separation of concerns and component-based web development. The framework focuses on XML and XSLT publishing and is built using the Java programming language. The flexibility afforded by relying heavily on XML allows rapid content publishing in a variety of formats including HTML, PDF, and WML. The content management systems Apache Lenya and Daisy have been created on top of the framework. Cocoon is also commonly used as a data warehousing ETL tool or as middleware for transporting data between systems.

XPath 2.0 is a version of the XPath language defined by the World Wide Web Consortium, W3C. It became a recommendation on 23 January 2007. As a W3C Recommendation it was superseded by XPath 3.0 on 10 April 2014.

In computer hypertext, a fragment identifier is a string of characters that refers to a resource that is subordinate to another, primary resource. The primary resource is identified by a Uniform Resource Identifier (URI), and the fragment identifier points to the subordinate resource.

The identity transform is a data transformation that copies the source data into the destination data without change.

In computing, the two primary stylesheet languages are Cascading Style Sheets (CSS) and the Extensible Stylesheet Language (XSL). While they are both called stylesheet languages, they have very different purposes and ways of going about their tasks.

Oxygen XML Editor multi-platform XML editor, XSLT/XQuery debugger and profiler

The Oxygen XML Editor is a multi-platform XML editor, XSLT/XQuery debugger and profiler with Unicode support. It is a Java application, so it can run in Windows, Mac OS X, and Linux. It also has a version that can run as an Eclipse plugin.

The Template Attribute Language (TAL) is a templating language used to generate dynamic HTML and XML pages. Its main goal is to simplify the collaboration between programmers and designers. This is achieved by embedding TAL statements inside valid HTML tags which can then be worked on using common design tools.

XPath is a query language for selecting nodes from an XML document. In addition, XPath may be used to compute values from the content of an XML document. XPath was defined by the World Wide Web Consortium (W3C).

XQuery is a query and functional programming language that queries and transforms collections of structured and unstructured data, usually in the form of XML, text and with vendor-specific extensions for other data formats. The language is developed by the XML Query working group of the W3C. The work is closely coordinated with the development of XSLT by the XSL Working Group; the two groups share responsibility for XPath, which is a subset of XQuery.

A Processing Instruction (PI) is an SGML and XML node type, which may occur anywhere in the document, intended to carry instructions to the application.

XML transformation language

An XML transformation language is a programming language designed specifically to transform an input XML document into an output document which satisfies some specific goal.

Tritium is a simple scripting language for efficiently transforming structured data like HTML, XML, and JSON. It is similar in purpose to XSLT but has a syntax influenced by jQuery, Sass, and CSS versus XSLT’s XML based syntax.

References

  1. https://pypi.python.org/pypi/diazo
  2. https://github.com/plone/diazo/
  3. http://wiki.nginx.org/HttpXsltModule
  4. nginx-xslt-html-parser, Laurence Rowe
  5. Nginx with HTML xslt support (html-xslt on Google code), patches Nginx 0.7.67 from 15 June 2010