Introduction
In Part 1 of this series, we looked at the background behind the XML reports in 12d Model and how to create a new report template. Now, in this post, we will make some minor changes to the way the report template and look at how they affect the output.
If you haven’t yet read Part 1, I recommend you do so now. This post assumes that you have already followed the steps in Part 1 and we have:
- Copied the default “html tables” report template/XSLT (super_alignment_report_htm.xslt) into the User directory and renamed it to super_alignment_report_htm_advanced12d.xslt
- Defined a new report template called “html Advanced12d” inside 12d Model via the panel
Minor modifications – Headings and text
Now that we have our custom XSLT and have added our custom report template to 12d’s list of template, we can look at actually modifying our report. I’ll first show you how to make some basic modifications- changing headers or text- before we look at more advanced ways of modifying our report.
Open up the XSLT- super_alignment_report_htm_advanced12d.xslt – in your text editor. If you need to, enable XML syntax highlighting.
A few things to mention about the XSLT file and XML in general:
- XSLT is itself written in XML.
- The XSLT consists of nodes, which can be different types- element, text, attribute, comments, etc.
- The XSLT document is tree-like and can have nested branches.
- An element is an item between angle brackets- < and > and each element must have a closing tag. e.g.
<example></example>
or<example/>
- Comments are contained within <!– and –> . e.g.
<!-- This is a comment -->
- XSLT is a set of templates that match different parts of an XML document and produce output (or not) based on that data.
<h1></h1>
and comments ( <!-- This is a comment -->
). HTML is a lot more strict and regulated about the tags allowed, what they mean and how they are displayed. For more information on HTML, see Wikipedia or W3Schools.With that brief introduction to XML and XSLT, let’s look at a typical report produced by the default “html tables” report type from the Super Alignment Report panel.
To make some basic changes to, say, for example, the headings, we need to find where in the XSLT those headings are output. The easiest way to do this is by searching in your text editor for one of the headings. In my example, I find the first set of headings for the Horizontal IPs section starting at line 153. For basic modifications, we can edit and replace the text between elements, so long as we don’t modify the elements themselves or the structure of the elements.
153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 |
<thead> <tr bgcolor="#d2d2d2"> <th style="text-align:right; "> <span> <xsl:text>XCOORD</xsl:text> </span> </th> <th style="text-align:right; "> <span> <xsl:text>YCOORD</xsl:text> </span> </th> <th style="text-align:right; "> <span> <xsl:text>RADIUS</xsl:text> </span> </th> <th style="text-align:right; "> <span> <xsl:text>LEADING</xsl:text> </span> </th> <th style="text-align:right; "> <span> <xsl:text>TRAILING</xsl:text> </span> </th> </tr> </thead> |
Once you’ve made those basic changes, you can generate a report from 12d Model, using your custom report type and check the resulting output.

Next, we’ll look at some extra formatting changes we can make.
i am trying to get 12d to output a report that only produces the 3D length of a super string and the start and end point information as coordinates without including any information for the verticies in between. any guidance on how i can achieve this would be very much appreciated
Trent, I think the best you could do without a custom macro would be to use the Attribute Manipulator to add the Length 3d as a vertex attribute. Then you could use the XYZ General output to report the XYZ and attribute value. Unfortunately, I can’t think of any way of not reporting on the intermediate points.
You could also potentially write an XSLT to convert a 12dXML file to the required output. That would probably take longer to write than a macro!
Depending on what you’re after, it would be a very quick and easy macro. Let me know if you’re heading down that path. I could probably whip something up in an hour or two.