Single Source Publishing

"Single source publishing" is the ability to use one source of information for generating multiple types of output. We're briefly going to show how the XML Report tool can be used for publishing both to the internet and to print media.

Single Source Publishing: Information Source
Single Source Publishing: Web using HTML+CSS Single Source Publishing: Print using XSL-FO and PDF

Single Report Format

The report definition itself has been designed in such as way as to abstract the details of formatting and layout, so that you don't have to worry about how to position text and how to switch fonts or colors or styles. Instead, you attach various input sources, draw the report, preview it until you are happy, and only then commit to a form of output.

XML Report Code Generation Options

Once the report is designed, it can be saved as code that does the actual work. That code can be used as part of any project, since it is industry-standard and requires no extension functions.

XML Report: Generate Transformation dialog

The types of programming languages supported are:

  • XSLT 1.0
  • XSLT 2.0
  • XQuery 1.0

Each has their own advantages.

XSLT 1.0 is supported by the greatest number of processors, including Saxon 6.x and Xalan.

XSLT 2.0 writes XSLT 2.0, which works extremely well with the highly-optimized Saxon 8.x engine. Saxon 8.x supports schema-aware processing. Using this as a choice allows considerably more power and flexibility in using dynamic properties since it allows XPath 2.0 expressions.

XQuery 1.0 writes XQuery code. Similar to XSLT 2.0, this code uses XPath 2.0 expressions, and runs well on any standards-conformant XQuery engine, including DataDirect XQuery and Saxon.

Now any of these can be set to write either web or print code. Let's see how that's done next.

Specify Web or Print Output

At the same time you choose whether you want to generate the code that generates the report in XSLT or XQuery, you can also choose which form of output to use: HTML+CSS for the Web, or XSL-FO for documents (which can be served on the web or printed).

This still leaves us with the questions:

  • What differences are there between publishing for the web and publishing to paper or another electronic document format?
  • What happens when the structure of the content changes?

Web Report Format XML Web report format

HTML+CSS means Hypertext Markup Language plus Cascading Style Sheets. These are both W3C standards.

Print Report Format XML Print report format

XSL-FO means generating code that writes XSL Formatting Objects. This can be rendered by FO processors such as the open-source Apache FOP or RenderX XEP. "Rendering" as a post-processing step turns the XSL-FO into some final form — and in this case, it's put into a Portable Document Format. For more information on the structure and capability of PDF files, see the PDF Reference pages.

Change Management

When you need to change the report — either because the input data changes in structure, or because the output requirements change, you change the report itself, and then regenerate the code. You don't have to worry about code merging or propagating differences between the web and print versions, since they share a common ancestor.

Multi Channel Publishing

This subject of single source printing is closely related to multi-channel publishing. Follow that link to learn more about using reports and generated code in pipelines to write to even more types of output, all from the same input.


Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Try Stylus Single Source Publishing Tools

Build Single Source Publishing applications with Stylus Studio® — Download a free trial today!

Learn XQuery in 10 Minutes!

Say goodbye to 10-minute abs, and say Hello to "Learn XQuery in Ten Minutes!", the world's fastest and easiest XQuery primer, now available for free!

Ask Someone You Know

Does your company use Stylus Studio? Do your competitors? Engineers from over 100,000 leading companies use Stylus Studio, and now you can ask someone from your own organization about their experiences using Stylus Studio.

Top Ten XQuery Trends

Read about the top 10 XQuery Trends and how they will impact change the way enterprise software applications are built.

Free Stylus Studio XML Training: