In V10, 12d Model introduced the use of XML reports for a few of the reporting options in the software. Prior to this any customisations or modifications to the formatting of reports by clients required either manual editing in a text editor or in 12d- e.g. deleting columns, changing headings, etc, or a custom 12d app to be written. The move to XML reports allows clients and 12d to more easily modify the format of these reports or add custom reports. Here I will give an introduction to which reports in 12d Model use the new XML format and explain the process for customising XML reports.
XML, XSLT, XPath – What does it all mean?
XML is a markup language defined by the W3C and designed to markup documents so that they are easy to read by both humans and machines.
XSLT is a related technology that is used to convert (transform) a document into another format- XML, HTML for web pages, plain text or even PDF. The source document is typically XML, though it does not need to be. XSLT files themselves are written in XML and use XPath to query parts of the source document being transformed. The XSLT specification can also be found at W3C. XSLTs are also sometimes called XML stylesheets.
XPath is another related technology that is used to define the syntax for the structure of an XML document and provides methods for navigating that structure (a query language). It is used heavily in XSLT to refer to parts of the XML and is also defined by the W3C. An XML document is effectively represented as a tree of many elements or nodes and the XPath is used to select specific parts of the tree for processing.
All three technologies are related and all will be used in this post. I will not be giving a detailed background or tutorial into either of these technologies, but should you wish to know more about them, there are plenty of resources online to help you.
A few I recommend:
What you will need
Although there are a number of software tools available that can create custom XSLTs (e.g. from Altova, Stylus Studio, oXygen XML), most of these cost money so I will be showing a way to create/modify reports using a basic text editor. If you are making substantial modifications or creating an XSLT from scratch, it may be worth using one of the paid software options out there. For these posts, we’ll simply be making changes to existing XSLTs, so a text editor should be enough.
However, not all text editors are created equal. I recommend a text editor that supports syntax highlighting (specifically for XML files) and code-folding. Both of these features will make working with XML and XSLT files much easier. I also recommend a text editor that has full support for Unicode. I personally use Notepad++, which is free and supports all of the mentioned functionality and much more. Download it at http://notepad-plus-plus.org/. Only a masochist would use the default Windows Notepad for this.
You’ll also need a copy of 12d Model (duh) for testing. I don’t know if this will work on the Practise Version, but I’m guessing if you’re reading this you already have a full version of 12d Model, V10 or above. If you don’t have a copy of 12d Model, get in contact with your local sales person.
Ok, now we’ve got a little bit of background and the tools to help us, let’s continue.