XML workflow: gathering specifications for output
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.
This is the first of three case studies about balancing creativity and standardization in XML workflows. This content first appeared in tcworld magazine.
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:
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.
Download the file for PDF specifications
Next month: InDesign XML for well-designed print layouts
Stylesheet specifications can also be maintained in a csv or an excel file at a specific location. A script can do some stuff automatically:
1. Go to the specific location to retrieve the latest version of the stylesheet specification.
2. Scan the csv/excel file to retreive the variable values.
3. Apply the values to output generation.
4. Save the generated file or files to a specfic location for easy retrieval by users/readers.