Skip to main content
January 25, 2016

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.

XML workflow: transforming source XML files into PDF file

Typical XML-to-PDF process (image by Gretyl Kinsey)

Coding in the XSL-FO stylesheets controls the formatting of the PDF output. The following sample code defines first-level headings:

SansBold
14pt
15pt
normal
normal
0pt
#000000
42pt
4pt

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.

table in Word file for specifying page size

Word file excerpt with page size information

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