ecrespo
13 years agoOccasional Contributor
How can I compare two .xps files?
I'm currently using TC 8.70
I do have to compare two .xps files. Since they are inherently xml files, I thought I could follow the procedure outlined in the Help to compare XML files from a script. However, when creating the checkpoint the following Exception is raised:
The document is invalid. Error: An invalid character was found in text content.
The code I'm using is directly from the TC Help manual:
function CreateXMLDemo()
{
var XMLDoc;
// Checks if NewXMLCheckpoint already exists in the Stores | XML collection.
if (! XML.Contains("NewXMLCheckpoint"))
{
// Creates an IXMLDOMDocument object.
XMLDoc = Sys.OleObject("Msxml2.DOMDocument.6.0");
XMLDoc.async = false;
// Loads data form the XML file to the IXMLDOMDocument object.
var TestingDirectory = Application.GetTestingDirectory("HB003\\");
var fileExpected = TestingDirectory + "eReport.xps";
XMLDoc.load(fileExpected);
// Creates NewXMLCheckpoint and checks if the creation is successful.
if (XML.CreateXML("NewXMLCheckpoint", XMLDoc)) //--> This is where it fails
}
Thanks in advance for your help
I do have to compare two .xps files. Since they are inherently xml files, I thought I could follow the procedure outlined in the Help to compare XML files from a script. However, when creating the checkpoint the following Exception is raised:
The document is invalid. Error: An invalid character was found in text content.
The code I'm using is directly from the TC Help manual:
function CreateXMLDemo()
{
var XMLDoc;
// Checks if NewXMLCheckpoint already exists in the Stores | XML collection.
if (! XML.Contains("NewXMLCheckpoint"))
{
// Creates an IXMLDOMDocument object.
XMLDoc = Sys.OleObject("Msxml2.DOMDocument.6.0");
XMLDoc.async = false;
// Loads data form the XML file to the IXMLDOMDocument object.
var TestingDirectory = Application.GetTestingDirectory("HB003\\");
var fileExpected = TestingDirectory + "eReport.xps";
XMLDoc.load(fileExpected);
// Creates NewXMLCheckpoint and checks if the creation is successful.
if (XML.CreateXML("NewXMLCheckpoint", XMLDoc)) //--> This is where it fails
}
Thanks in advance for your help