We're going to expand on the theme from Single Source Publishing to include writing to even more disparate outputs types from the same input. You saw in that demonstration how a single report definition can be used to generate HTML+CSS for the web and also XSL-FO ➔ PDF for document delivery or print media. This time we're going to add more output sources, and show how all can be generated from the same input, at the same time.
We're going to use the XML Pipeline and
XML Publishing features of <%= ConfigurationManager.AppSettings["SS"] %>
to accomplish our goals. We'll use the same shirts.xml
sample data and shirts.report report design
that we referred to in the XML Report tutorial.
![]() |
||||
![]() |
||||
![]() |
![]() |
|||
![]() |
||||
![]() |
![]() |
|||
![]() |
||||
![]() |
![]() |
|||
![]() |
||||
![]() |
![]() |
|||
This part is easy; we take the shirts.report and tell it to generate code.
Let's do XSLT 2.0, and make the output for HTML+CSS.
And this is easy also. Take that same shirts.report
and generate XSLT 2.0 code to write XSL-FO.
For this part, we need a small bit of XSLT. Using the <%= ConfigurationManager.AppSettings["SS"] %> XSLT tools, including the editor, we can quickly generate a piece of XSLT that writes in a flat text format.
But we can do even better. <%= ConfigurationManager.AppSettings["SS"] %> includes a set of adapters, and we can use the comma-separated-value adapter to do this with almost no work, just by writing the XML data through the adapter.
A few minutes work using the EDI tools along with the XSLT mapper, and a map is produced between the input document and the EDIFACT INVRPT message that our reseller is expecting. This probably goes into their catalog production system, but who knows? The point is, we can deliver whatever they need.
Now all we need to do is to plop these components onto the XML Pipeline canvas. Dragging them from the Project window or File Explorer window is first, followed by drawing lines. Then clicking on the output ports of each bottom glyph, and naming the output. In case you just want to skip to the end and try it, here is everything all packaged up for you as a <%= ConfigurationManager.AppSettings["SS"] %> project file (zipped).
Here's what we accomplished together, using <%= ConfigurationManager.AppSettings["SS"] %>'s mapping, pipelining and publishing tools. Using the shirts demonstration project, you can try everything covered here yourself — download and try a free evaluation copy today!
|
The web output, as HTML+CSS, it just a plain web page, and as such is suitable for inclusion directly into your web site. The simple things should be simple to do. |
![]() |
The XSL-FO output, which is post-processed into a PDF document, can be used for printing to a variety of high-resolution devices, or left as-is for download over the internet. |
![]() |
With no code at all, this output went through the adapter and was turned into a file suitable for using with a spreadsheet. In this case, just double-clicking on the output file opened Microsoft® Excel and displayed what you see. |
![]() |
A little bit of mapping, and what started off as an XML file is ready to be transmitted to a partner or vendor as EDI. We even validate the output to make sure nothing incorrect slips through. | |
| <%=Global.ThumbOf("/images/publish/multi-output-web.gif", 110, "Multi channel web publishing")%> | <%=Global.ThumbOf("/images/publish/multi-output-pdf.gif", 110, "Multi channel print publishing")%> | <%=Global.ThumbOf("/images/publish/multi-output-ss.gif", 110, "Multi channel spreadsheet publishing")%> | <%=Global.ThumbOf("/images/publish/multi-output-edi.gif", 110, "Multi channel EDI publishing")%> |
Build Single Source Publishing applications with <%= ConfigurationManager.AppSettings["SS"] %> — Download a free trial today!
Read about the top 10 XQuery Trends and how they will impact change the way enterprise software applications are built.