Last week, my colleague Marcos guided us through the still relatively new Oracle offering called XML Publisher. During a session of our Knowledge Center on Oracle Development Tools, we saw XML Publisher in action and used it ourselves. We also had quite a bit of discussion, whether XML Publisher will replace Oracle Reports and to what extent it may be used with Java/J2EE powered projects. We concluded that functionality wise XML Publisher is ready to take over from Oracle Reports. However, the current licensing policy as we understand it is rather prohibitive – $40K per processor, $30k if you’ve already licensed Application Server – or $40 per employee (not end user) which, depending on the actual conditions, could prove interesting.
XML Publisher first came to my attention during Oracle World, Fall 2004. I wrote about it in the article Eating your own dogfood – use of Oracle Development tools within the Oracle Applications development group – Reporting: birth of a new tool: XML Publisher, an interview with John Wookey during Oracle World 2004 in Amsterdam. It is created initially to facilitate all those customers of the Oracle E-Business Suite that require reports based on data within the Oracle E-Business Suite and with customized layout. Oracle was facing more and more customers using the standard shipped reports and requiring specialized layout for those reports, often because of local regulations. Oracle realized it would not be possible to ship all those customized layouts as part of the core product, so XML Publisher was developed to allow customers to create their own report layouts based on standard (or even custom) data sources. The initial intention was to use all the curent reports in the E-Business Suite as Data Sources – RDFs ran with XML as output format – for the newly developed XML Publisher templates. It now seems that Oracle has a RDF2RTF processor – a tool that takes Oracle Report Definitions and converts them to XML Publisher style templates. However, this tool is not yet available external to Oracle, although that does seem to be the plan.
More details on XML Publisher can be found among other resources in this article by Mark Rittman: A First Look At XML Publisher , More on XML Publisher and Wrapping up on XML Publisher . XML Publisher can be downloaded from Oracle MetaLink.
Report-templates for XML Publisher are in fact RTF documents that are created using a Word plug-in. (According to Mark, there will be a plugin for Excel shortly. ) You can create the layout of the report using the full power of MS Word – quite handy compared to Oracle Reports Builder and much more convenient for end users. Including images, tables, indexes and other more interesting layout options is as effortless as with normal documents.
The plugin part is used when the dynamic data elements are introduced into the template. Marcos demonstrated how you can first link the current template to an XML Data Source – which can be an XML Document on the file system or the internet or an SQL Query (also see More on XML Publisher). In the template itself, we can include elements from that XML source (internally specified through XPath expressions that we can though not need to edit), just by picking them in a wizard. We have the full range of XPath/XSLT expressions at our disposal, allowing us to manipulate the contents from the XML source before displaying it in the report. Note that here we will lose the end user and require a real developer or someone trained for day-to-day administration of the application.
Marcos demonstrated how simple it is to create iterations – loops over sets of records that are typically displayed in tables or bullet lists in the report output. He also showed us how references to images can be dynamic: that this the URL for the image can be constructed while generating the report output from the values found in the XML source.
We can preview the Report from the template at any time; the preview is available in PDF, HTML and Excel format. The data in the preview is the data from the XML Data Source we have attached to our template editing session.
The XML Publisher plugin allows us to export the template definition in several formats, including XSL-FO and XSLT. The latter is an XSLT stylesheet that contains an awful lot of XSL-FO elements, embedded in an XSLT stylesheet. Taking this stylesheet, we can take an XML source and transform it to XSL-FO output – using any XSLT transformation engine, like Apache Xalan, Saxon or Oracle XDK. The XSL-FO document can be edited in one of several XSL-FO editors or rendered – more likely – using render engines like Apache FOP, to output formats like PDF, PS, SVG or RTF. Of course these functions are normally exectued by the XML Publisher Server, but it can be interesting to use the XSL-T created with the XML Publisher plugin for Word in more customized ways. Note that Report definitions are stored by the XML Publisher plugin as an XDO file along with an RTF document. This XDO file is a custom XML format, that describes the XML Data Source to be used when the report is executed.
XML Publisher is based primarily on XML, XSL-FO (FO= Formatting Objects) and XSL-T (T=Transformations). It can render output in various formats, including HTML, PDF, RTF (Rich Text Format) and Excel (although currently the Excel output is basically just HTML output interpreted by Excel). The approach taken with XML Publisher as demonstrated by Marcos is very much like a PostScript/PDF Document Generator AMIS developed almost three years ago for one of our customers: we used HTML to define the Report template instead of RTF, had a less elegant way of injecting references to dynamic data elements and could not handle record sets. However, the basic approach using a template developed in Word by end-users, using a XSL-T stylesheet brimming with XSL-FO elements to transform XML datasets was there to, as was the rendering in PDF from XSL-FO. Well, in hindsight it sounds like the obvious approach, so of course there are many similarities.
All in all, this session provided a very useful overview of where XML Publisher currently is, how it can be used and what the internals are.