From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
10-07-2014 05:25 PM
Hello,
While attempting to write a custom XML translation (XSL) for a TestStand result XML file, I found that the XML header would get corrupted and the string "; charset=iso-8859-1" would be inserted in the XML header. When the tag "omit-xml-declaration" is set to "yes", the first line of my XML output file still has the string "; charset=iso-8859-1" inserted into the first line. I think this may have something to do with the default TS reportgen_xml.seq sequence. Does anyone have any ideas?
XSL Source (just the beginning)
<?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" id="TS14.0.0"> <xsl:namespace-alias stylesheet-prefix="xsl" result-prefix="#default"/> <xsl:namespace-alias stylesheet-prefix="msxsl" result-prefix="#default"/> <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes" omit-xml-declaration="no" />
XML Source (just the beginning)
<?xml version="1.0" encoding="iso-8859-1" ?><?xml-stylesheet type="text/xsl" href="C:\Program Files (x86)\National Instruments\TestStand 2014\Components\Models\TestStandModels\StyleSheets\myNewStylesheet.xsl"?> <Reports> <Report Type='UUT' Title='UUT Report' Link='-1-2014-10-7-10-22-44-592' UUTResult='Failed' StepCount='8'> <Prop Name='UUT' Type='Obj' TypeName='UUT' Flags='0x0'> <Prop Name='SerialNumber' Type='String' Flags='0x0'> <Value></Value> </Prop> <Prop Name='UUTLoopIndex' Type='Number' Flags='0x0'> <Value>1</Value> </Prop> <Prop Name='CriticalFailureStack' Type='Array' LBound='[0]' HBound='[0]' ElementType='Obj' Flags='0x0'>
XML Output: (first line)
<?xml ve; charset=iso-8859-1rsion="1.0"?>
Thanks,
Aaron
10-07-2014 09:42 PM
10-08-2014 07:48 AM - edited 10-08-2014 07:49 AM
Shashidhar,
Thank you for replying. To give you a better understanding of what is happening, I will include more extensive code segments. I will also note that when I put the input XML and XSL into an online XML transformer, I get the results I would expect (http://www.freeformatter.com/xsl-transformer.html#ad-output)
Input XML:
(See attachment "Computer Motherboard Test Sequence_Report[8 33 34 AM][10 8 2014].xml")
Input XSL:
<?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" id="TS14.0.0"> <xsl:namespace-alias stylesheet-prefix="xsl" result-prefix="#default"/> <xsl:namespace-alias stylesheet-prefix="msxsl" result-prefix="#default"/> <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes" omit-xml-declaration="no" /> <xsl:template match = "/"> </xsl:template> </xsl:stylesheet>
Output XML from TestStand 2014:
<?xml ve; charset=iso-8859-1rsion="1.0"?>
Output from the online transformer:
<?xml version="1.0" encoding="UTF-8"?>
It still seems to me like this is not an XSL issue, but something going on in the report generation sequence.
10-09-2014 03:01 PM
Aaron, Did you base your XSL after one of the stylesheets shipped with TestStand? If not, like Shashidhar said I recommend doing a side by side comparison to identify the key differences.
10-13-2014 12:45 AM
Aaron
I was able to reproduce the issue you have specified and have raised a bug report.
I need more information about your use case.
In your stylesheet, the value of 'method' attribute in xsl:output element is set to "xml". This specifies that you are transforming XML report into your own XML format. Is that right?
Starting from TestStand 2012, you can have your own report generator using the plugin architecture. You can use plugin architecture to create report in custom format instead of using stylesheet.
TestStand transforms XML report and displays the output in the ReportView Control. Do you want to display the transformed XML report, which is also in XML format, in the ReportView control?
- Shashidhar