10-10-2025 04:16 AM
In our environment the test data from mulitple TS stations is concentrated on a central quality department DB.
Reports are manually created on stations by operators only when required, but also the quality guys would like to generate TS styled reports in case of customers demand.
Since TS is not installed on the quality department PCs, we cannot rely on TS sequences or TS DLLs for this task.
The idea is to create a standard ATML report sourcing data from the central DB and them parse it with one of the TS stylesheets (e.g. TR5_Expand.xsl).
We tried to do that with a simple python script based on lxml library:
import lxml.etree as ET
FILE_XSLT = 'xslt_convert/in/TR5_Expand.xsl'
FILE_ATML = 'xslt_convert/in/report.xml'
FILE_REPORT = "xslt_convert/out/report.html"
dom = ET.parse(FILE_ATML)
xslt = ET.parse(FILE_XSLT)
transform = ET.XSLT(xslt)
newdom = transform(dom)
infile = ET.tostring(newdom, pretty_print=True)
outfile = open(FILE_REPORT)
outfile.write(infile)
But it fails with:
lxml.etree.XSLTApplyError: XPath evaluation returned no result.
Do other options exist for this task?
Thanks for reading
Raffaello
10-10-2025 04:49 AM
Trying to understand your issue correctly:
the Result Data is stored in the Qualtiy department database as "raw data" in a SQL database?
So you use some kind of routine, which extracts data for a single DUT form the DB into a XML / ATML file.
Once you try to apply the stylesheet to this file, you get this error.
Correctly?
10-10-2025 05:29 AM
the Result Data is stored in the Qualtiy department database as "raw data" in a SQL database?
Correct
So you use some kind of routine, which extracts data for a single DUT form the DB into a XML / ATML file.
Not yet written but this is the idea
Once you try to apply the stylesheet to this file, you get this error.
We got this error trying to apply the stylesheet to a TS generated ATML.
10-10-2025 05:55 AM
Thanks for clarifying!
Back in the day, TestStand used the MS Internet Explorer to do the rendering, today this is Chromium based. Each of those renderers has their specialities / quirks.
I guess that the package you are using is not Chromium based. At least this might explain the error message
10-13-2025 09:39 AM
Hi,
There are couple of things to try. The schema files for TestStand reports ship with TestStand under the C:\Program Files\National Instruments\TestStand 2025\Components\Models\TestStandModels\ATML\Schemas\ATML 5. You can use that to validate the generated XML files. If they validated, then the stylesheets should work.
The other approach, which I recommend is to use XMLPack (XML Packaging Utility - NI) to generate a set of files that can be opened without TestStand on the machine. With a little code you automate it using CLI.
Regards,
Anand Jain
NI
10-14-2025 07:23 AM
The other approach, which I recommend is to use XMLPack (XML Packaging Utility - NI) to generate a set of files that can be opened without TestStand on the machine. With a little code you automate it using CLI.
Thank you Jain for the directives.
I have tried the XML Packaging Utility which successfully populated a folder with the source XML file and all the other files needed for report rendering, including the XSL file.
Anyway, opening the XML file in a browser (Edge or Chrome) results in a white page.
Adding the HTML extension to file name only makes the browser display the data in a cramped unformatted style.
10-15-2025 09:03 PM
Hi,
Chrome or Edge does not support viewing XML reports. You can view the XML report using the viewer from the following link(TestStand ATML and XML Report Viewer Support After Internet Explorer Retirement - NI).
Regards,
Anand Jain
NI