This is an old revision of the document!
Table of Contents
TapeTrack XML Stylesheet
The TapeTrack XML Stylesheet file, normally named tapetrack.xslt, controls how TapeTrack billing XML is displayed in a web browser or compatible Desktop UI.
The stylesheet is used by TMSS10LogStatsProcess when producing TapeTrack billing XML.
The generated XML contains billing information such as:
- Customer-ID.
- Billing item code.
- Item description.
- Quantity.
- Unit cost.
- Total charge.
The stylesheet converts this XML data into a readable layout for review.
The stylesheet does not calculate charges, select a billing package, or change the underlying billing information. Billing calculations are performed by TMSS10LogStatsProcess using the Customer Description Map, Package Map and Billing Rules.
Purpose
The tapetrack.xslt stylesheet provides a consistent and readable presentation of TapeTrack billing XML.
The file can be used to:
- Display billing XML as a formatted table.
- Make billing output easier to review.
- Display customer, item, quantity, rate and total values.
- Apply consistent headings, colors and page formatting.
- Improve the readability of billing information before it is submitted to QuickBooks.
- Provide a presentation layer without changing the underlying XML data.
The stylesheet separates the presentation of billing information from its calculation.
| Component | Purpose |
|---|---|
| Billing XML | Contains the calculated billing data. |
tapetrack.xslt | Defines how the billing data is displayed. |
| Desktop UI or browser | Applies the stylesheet and displays the formatted billing information. |
File Location
The tapetrack.xslt file can be stored in any directory accessible to the account running the billing process and the application displaying the XML.
For ease of administration, it is recommended that the stylesheet is stored with the other approved billing configuration files.
Example Windows location:
C:\Program Files\TapeTrack\TapeTrack Framework Server\etc\billing\tapetrack.xslt
Example Linux location:
/etc/tapetrack/billing/tapetrack.xslt
The location of the stylesheet can be supplied to TMSS10LogStatsProcess using the -X argument.
If the -X argument is not supplied, the default stylesheet name is:
tapetrack.xslt
File Format
The TapeTrack stylesheet is an XSLT file containing XML-formatted transformation instructions.
The file normally uses the .xslt extension.
A billing XML file references the stylesheet using an XML processing instruction.
Example:
In this example, the billing XML expects to find a stylesheet named tapetrack.xslt.
- tapetrack.xslt
<?xml version="1.0" ?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <html> <head> <title>Sample Processed Statistics Style Sheet</title> </head> <body> <table cellpadding="0" cellspacing="20" border="0"> <thead> <th>Customer</th> <th>ItemCode</th> <th>Description</th> <th>Count</th> <th>Cost</th> <th>Total</th> </thead> <xsl:apply-templates select="tapetrack_data"> </xsl:apply-templates> </table> </body> </html> </xsl:template> <xsl:template match="item"> <tr> <td> <xsl:apply-templates select="customer"> </xsl:apply-templates> </td> <td> <xsl:apply-templates select="itemcode"> </xsl:apply-templates> </td> <td> <xsl:apply-templates select="description"> </xsl:apply-templates> </td> <td align="right"> <xsl:apply-templates select="count"> </xsl:apply-templates> </td> <td align="right">$ <xsl:apply-templates select="cost"> </xsl:apply-templates> </td> <td align="right">$ <xsl:apply-templates select="total"> </xsl:apply-templates> </td> </tr> </xsl:template> </xsl:stylesheet>
The stylesheet reads each item element within tapetrack_data and displays its values as a table row.
Running TMSS10LogStatsProcess
Use the -X argument to specify the stylesheet used by TMSS10LogStatsProcess.
Example:
TMSS10LogStatsProcess -i US01.ttstats -M customer_map.txt -P package_map.txt -c default.ttsdef -X tapetrack.xslt > Billing_US01.xml
Where:
| Argument | Value | Description |
|---|---|---|
-i | US01.ttstats | Specifies the TapeTrack statistics input file. |
-M | customer_map.txt | Specifies the Customer Description Map. |
-P | package_map.txt | Specifies the Package Map. |
-c | default.ttsdef | Specifies the Billing Rules. |
-X | tapetrack.xslt | Specifies the XML stylesheet. |
| Standard output | Billing_US01.xml | Receives the calculated billing XML. |
The resulting XML contains a reference similar to:
<?xml-stylesheet type="text/xsl" href="tapetrack.xslt"?>
If the stylesheet is not stored in the current directory, specify the required path.
Example:
TMSS10LogStatsProcess ^ -i "C:\TapeTrack\Billing\Input\US01.ttstats" ^ -M "C:\TapeTrack\Billing\Config\customer_map.txt" ^ -P "C:\TapeTrack\Billing\Config\package_map.txt" ^ -c "C:\TapeTrack\Billing\Config\default.ttsdef" ^ -X "C:\TapeTrack\Billing\Config\tapetrack.xslt" ^ > "C:\TapeTrack\Billing\Output\Billing_US01.xml"
Relationship to Billing XML
The billing XML contains the calculated values.
Example:
<tapetrack_data> <item> <customer>US01</customer> <itemcode>New York STORAGE_OFFSITE</itemcode> <description>LTO Vault Storage Charge</description> <count>60</count> <cost>0.01</cost> <total>0.60</total> </item> </tapetrack_data>
The stylesheet determines how these values are displayed.
| XML Element | Displayed Value |
|---|---|
customer | US01 |
itemcode | New York STORAGE_OFFSITE |
description | LTO Vault Storage Charge |
count | 60 |
cost | 0.01 |
total | 0.60 |
Changing the stylesheet may change headings, colors, number formatting or layout. It does not change the values stored in the XML.
The billing XML remains the authoritative billing output. The stylesheet is only a presentation layer.
Troubleshooting
XML Displays as Unformatted Text
Check that:
- The XML contains an
xml-stylesheetprocessing instruction. - The stylesheet filename is spelled correctly.
- The stylesheet exists at the referenced location.
- The Desktop UI or browser has permission to read the stylesheet.
- The stylesheet is valid XML.
- The stylesheet uses the correct XSLT namespace.
- The application supports XSLT processing.
Stylesheet Cannot Be Found
Confirm that:
- The
-Xargument specifies the correct stylesheet. - The file is named
tapetrack.xslt. - The XML stylesheet reference contains the correct path.
- The XML and stylesheet were copied to the Desktop UI together.
- A relative path is being resolved from the expected directory.
- The billing process is not referencing an old stylesheet location.
Billing Information Is Missing From the Display
The information may exist in the XML but not be selected by the stylesheet.
Check that:
- The expected elements exist in the billing XML.
- The stylesheet uses the correct element names.
- The
xsl:for-eachpath matches the XML structure. - The
xsl:value-ofexpressions match the required fields. - The stylesheet was designed for the current billing XML format.
Example selection path:
<xsl:for-each select="tapetrack_data/item">
Billing Values Are Incorrect
The stylesheet does not calculate billing values.
Check the following billing inputs instead:
- The
.ttstatsfile. - The Customer Description Map.
- The Package Map.
- The Billing Rules.
- The selected billing date range.
Changing tapetrack.xslt will not correct an incorrect quantity, unit cost or total stored in the billing XML.
Desktop UI Does Not Load the XML
Check that:
- The billing XML is complete and valid.
- The XML file has not been truncated.
- The stylesheet is accessible.
- The XML encoding is supported.
- The XMLQuickBooks mapping matches the XML elements.
- The Desktop UI has permission to read both files.
Recommended Practices
- Keep the stylesheet in a controlled billing configuration directory.
- Use one approved stylesheet for each billing environment.
- Do not maintain uncontrolled copies.
- Keep the stylesheet compatible with the current billing XML structure.
- Test stylesheet changes against representative billing XML.
- Confirm that all billing items are displayed.
- Do not use the stylesheet to alter billing values.
- Retain the stylesheet used for each billing period.
- Back up the stylesheet before making changes.
- Restrict write access to authorized billing administrators.
Security
The tapetrack.xslt file does not normally contain passwords or authentication details.
However, an XSLT file controls how billing data is transformed and displayed. Unauthorized changes could hide billing items, display misleading information or redirect the presentation to unexpected content.
Access should therefore be restricted to:
- TapeTrack administrators.
- Authorized billing staff.
- The service account that runs the billing process.
- The account used by the Desktop UI.
The file should not be publicly accessible or stored in an unsecured shared directory.
