XML Page Cannot Be Displayed Error with TestStand XML Report

Updated Sep 25, 2020

Reported In

Software

  • TestStand

Operating System

  • Windows

Issue Details

I have a test machine on a production floor that generates XML report files. I can easily view this data on my test machine, but how can I view this on another machine without TestStand being installed?

Currently when I open up the XML Report on a different machine, one of the following situations occur:
1. I see an unformatted report as raw XML code.
2. I get the following error message:

Solution

The root cause for the described issue is that additional stylesheet files are needed when displaying the XML reports. These stylesheets containing formatting information are installed on a computer when TestStand is installed, however they are typically not available on a computer without TestStand installed.

There are two main ways to solve this issue:
  1. Distribute the XML reports as a packaged XML/HTML file that contains the stylesheet information. This has to be done for every single report you want to view on a computer without TestStand installed.
  2. Copy the needed XML stylesheets onto the target computer. This needs to be performed only once per target computer.
Both methods use Internet Explorer to view the reports, no additional software installation is needed.


Option 1: Distribute the XML reports as a packaged XML/HTML File
The XML Packing Utility facilitates the redistribution of XML and HTML files created using TestStand's reporting capabilities. The XML Packing utility copies selected XML and HTML files, and any file referred to in the files to a specified destination folder. If a referenced file itself contains a reference to another file, then the other file will be copied as well. This includes stylesheets, image files, etc. This way all dependency files needed to display a report properly are collected. Follow these steps to do so:
  1. From the Sequence Editor toolbar, select Tools » Package XML/HTML Files for Distribution… to launch the XML Packaging Utility.  
    • Note: As of TestStand 4.2, you can also launch the XML Packaging Utility from the Windows Start menu directly by selecting Start » Programs » National Instruments » TestStand <version> » Tools » Package XML or HTML Files for Distribution...
  2. Click the Add button to browse for XML and/or HTML reports to include in the package. 
  3. Select a folder for the files to be packaged in the Destination Folder text box by manually typing the folder path, or by clicking Browse to browse to an existing directory. If you specify a directory that does not exist, you will be asked if you want to have the directory created for you when you package the files. 
  4. Click the Pack button. Upon successful packaging, there will be green checkmarks placed next to the XML and HTML report files, as well as any style sheets that the XML reports reference under Referenced Files.
The generated folder now contains the reports, as well as all referenced stylesheets. This folder can be transported to any computer or a network location for viewing of the XML and HTML reports. 


Option 2: Copy the needed XML stylesheets onto the target computer
Instead of using the XML Packaging Utility, you could also manually copy the stylesheets and their directory structure over to any computer you want to view the XML reports on.
  • Note: The directory structure of the stylesheet files needs to be identical on the computers.
  • If you are using the default, built-in stylesheets, use the following steps:
    1. Locate the TestStand directory on your first machine
      • Type %TestStand% into the address bar of a Windows File Explorer window, press Enter
  1. Take note of the file structure, because it will need to be recreated on your other machine(s)
    • The default file structure will be of the form C:\Program Files (x86)\National Instruments\TestStand <version>
    • Note: This location is commonly referred to as <TestStand>
  2. On any other machine that wants to view the XML file, create folders to match the following directories:
    • TestStand 4.0 and prior:
      • <TestStand>\Components\NI\Models\TestStandModels\StyleSheets
    • TestStand 4.1 and later:
      • <TestStand>\Components\Models\TestStandModels\StyleSheets
  3. ​​Copy over the contents of the StyleSheets folder
  • If you are using your own, customized stylesheets, use these steps:
    1. Locate the TestStand directory on your first machine
      • Type %TestStandPublic% into the address bar of a Windows File Explorer window, press Enter
    2. Take note of the file structure, because it will need to be recreated on your other machine(s)
      • The default file structure will be of the form C:\Users\Public\Documents\National Instruments\TestStand <version>
      • Note: This location is commonly referred to as <TestStandPublic>
    3. On any other machine that wants to view the XML file, create folders to match the following directories:
      • TestStand 4.0 and prior:
        • <TestStand>\Components\User\Models\TestStandModels\StyleSheets
      • TestStand 4.1 and later:
        • <TestStandPublic>\Components\Models\TestStandModels\StyleSheets
    4. ​​Copy over the contents of the StyleSheets folder

Additional Information

XML Reports use an XML Stylesheet, an .xsl file, to take the raw XML data and display it in a formatted fashion. The very first lines of an XML Report file contains a link to the location of the XML Stylesheet file.

The reason that you see this behavior when you open the XML Report from a different computer is because TestStand locates its Stylesheet files in a central location and does not create a new copy in the directory of the report file for every report. 
This XML Stylesheet is typically located at:
<TestStand>\Components\NI\Models\TestStandModels\StyleSheets

When you copy over the XML Report to another machine that does not have TestStand installed, these stylesheets don't exist at those locations, and so Internet Explorer cannot find them and cannot display the formatted XML Report.