Hello everyone,
I'm developing a custom XML report for TestStand and I'm a bit confused about how to handle certain characters. For example, lets say I have a test step titled "Check that current is < 50mA". Now, when this data is written into the XML report it can be found between the Step Name tags, like this
<Step Name>Check that current is <50mA</Step Name>
Now the character causing the problem is "<" as XML presumes it indicates a new tag. Looking through XML resources it seems one way to escape these characters is to use the CDATA tags like this:
<Step Name><![CDATA[Check that current is <50mA]]></Step Name>
or to specify in the .xsl file "disable-output-escaping="yes" in the for these affected fields, like step name. However I'm concerned that by using the "disable-output-escaping" method I will encounter problems when feeding the XML file into a parser.
Now I'm a bit curious about how different parsers act with the CDATA tag, if I parse the step name fields will I get "Check that current is <50mA" or will I get ><![CDATA[Check that.....]]>. Any ideas?
Currently I'm using a function from the modelsupport.dll to replace these invalid characters with entity references, for example "<" is replaced with < but this is not a good solution from the parser point of view.
Best regards and thanks in advance for any advice,
Aleksi