mercredi 22 avril 2015

XMLUtil not showing details of mismatched xml attributes

I am using QTP's XMLUtil to compare 2 xmls. Everything works fine except if there are any differences in tag elements. For example,

In XML1, the tag is:

<DirtyBondPrice PriceType="Price" Currency="GBP" Weight1="02">110</DirtyBondPrice>

In XML2, the tag is

<DirtyBondPrice PriceType="Price" Currency="USD" Weight1="02">110</DirtyBondPrice>

Code snippet

booleanResult = objXML1.Compare(objXML2, objResultsXML)
objResultsXML.SaveFile "C:\Users\pankaj.jaju\Desktop\6.xml"

So the difference is show as follows

<mic_root state="mismatch">
  <RepoTrade state="mismatch">
    <SpecificDetail state="mismatch">
      <DirtyBondPrice mic_elemA_attr="%s=&quot;%s&quot;;%s=&quot;%s&quot;" mic_elemB_attr="%s=&quot;%s&quot;;%s=&quot;%s&quot;" state="mismatch" />
    </SpecificDetail>
  </RepoTrade>
</mic_root>

What I was expecting (and according to QTP help file what should be displayed):

<DirtyBondPrice mic_elemA_attr="Currency="GBP"" mic_elemB_attr="Currency="USD"" state="mismatch" />

Is this a bug in QTP's XMLUtil API?

Aucun commentaire:

Enregistrer un commentaire