HP Matrix Operating Environment Chargeback
Technical white paper | HP Matrix Operating Environment Chargeback
17
<tr><td><br/></td></tr>
<tr><td><br/></td></tr>
</xsl:for-each>
</table>
</xsl:template>
</xsl:stylesheet>
Applying the formatter to the source data
An XML stylesheet instruction must be inserted at the top of the source XML file, just after the first XML tag, to indicate to
the web browser or Excel application that it should apply the XML transformations defined in the XSL file when rendering
the XML document.
Adding stylesheet tag to the source XML file
A partial XML example with the XML stylesheet tag added is shown below. The <?xml-stylesheet> element indicates
to the processing application which XSL transformation to apply to the XML. The XSL file name must be specified in this
element and the file should be located in the same folder as the XML file.
Figure 22. Adding stylesheet instruction to allow the XML to be converted to HTML
<?xml version="1.0" ?>
<?xml-stylesheet type="text/xsl" href="getServiceUsageDetail_formatter.xsl"?>
<GetServiceUsageDetail>
<ServiceUsageDetail>
<date>2012-04-13</date>
<resourceUsageDetail>
…
</resourceUsageDetail>
<serviceInformation>
<billingCode>HR</billingCode>
<id>InfrastructureService:5aba985d-0376-4679-a577-21ca178902b4</id>
<name>intranet_service</name>
<organizationId>SERVICEPROVIDER</organizationId>
<owner>IO-CMS-QA-08\Administrator</owner>
<startDate>2012-04-13</startDate>
</serviceInformation>
</ServiceUsageDetail>
<ServiceUsageDetail>
…
</ServiceUsageDetail>
</GetServiceUsageDetail>
Opening the XML as a report in Microsoft Excel 2007
Open the XML file in Excel 2007 by selecting the XML using the “Open Office” button. Excel indicates that the file being
opened contains stylesheets. Select the Open the file with the following stylesheet applied radio button, as shown below.
Figure 23. Opening a file with stylesheet
When the application asks if you want to open a temporary file, click Yes.