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.

NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

XML Header Corrupted by TestStand 2014 (XSL and XML)

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

 

 

0 Kudos
Message 1 of 5
(4,614 Views)
Aaron,

Reportgen_xml.seq is responsible for creating the XML file. Only xsl file is responsible for translating XML file. Hence i am guessing the issue exists in the stylesheet. Default stylesheets shipped with TestStand does not have this issue. Compare your stylesheet with the one shipped with TestStand. You might be able to figure out the issue. Also if possible share your entire xsl file as it helps us to easily debug the issue.

- Shashidhar
0 Kudos
Message 2 of 5
(4,605 Views)

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. 

 

0 Kudos
Message 3 of 5
(4,593 Views)

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. 

0 Kudos
Message 4 of 5
(4,557 Views)

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

0 Kudos
Message 5 of 5
(4,513 Views)