It is a common stereotype that an XML workflow for content is rigid, unbending, and free of creativity.
In my experience, the opposite is true. Creativity is necessary to develop XML workflows, and—if developed with specific requirements in mind—these workflows enable creative solutions. Business requirements often demand flexibility in how content is developed and distributed.
Desktop publishing (DTP) software offers template designers a visual interface for developing the formatting of print and PDF output. The interface shows what the page will look like: the page size, the font for each paragraph, the spacing between paragraphs, and so on.
This visual aspect of template development is missing in structured workflows that generate automated outputs. Instead, programmers use a text or XML editor to develop stylesheet code that defines formatting. So, how can stylesheet programmers and DTP template designers collaborate most efficiently to identify formatting specifications for automated output?
Extensible Stylesheet Language-Formatting Objects (XSL-FO) is a common solution for creating PDF output from XML content.
Coding in the XSL-FO stylesheets controls the formatting of the PDF output. The following sample code defines first-level headings:
<xsl:variable name="level-1-family">SansBold</xsl:variable>In their early efforts to gather formatting information, Scriptorium’s stylesheet programmers extracted specifications from the paragraph styles, table styles, and so on, in the existing DTP templates. The programmers also received a list of changes from the template designers. Often, the designers made requests such as:
- “Make the chapter heading a little bigger.”
- “Change the heading color to the new corporate blue.”
These requests were perfectly reasonable, but programmatic formatting requires specific numbers. How many points is “a little bigger”? What is the Pantone color code for the corporate blue?
To improve communication between template designers and stylesheet programmers, a Scriptorium stylesheet programmer developed a process that relies on…stylesheets!
First, the programmer added detailed code comments to the stylesheets. For example, for the page size settings, the comment reads:
Physical page dimensions. US Letter is 8.5 in x 11 in; A4 is 8.3 in × 11.7 in. Dimensions that accommodate both paper sizes are 8.3 in x 11.0 in.He then developed another stylesheet-based process that extracts the code comments and creates a Microsoft Word file. The Word file explains each setting and includes the default value. The template designer reviews the settings, modifies the values as necessary, and returns the revised Word file to the programmer.
Using the Word document to collect values greatly streamlines the development process. Programmers receive specific measurements they can add to the stylesheets. Also, the detailed code comments serve as a reference to those who later maintain the stylesheets in the XML workflow.
Next month: InDesign XML for well-designed print layouts