Altova Mailing List Archives>Archive Index >xml-dev Archive Home >Recent entries >Thread Prev - >Thread Next - Re: [xml-dev] Compare Heirarchy of 2 XML Files Compare Heirarchy of 2 XML FilesTo: <xml-dev@-----.---.---> Date: 4/1/2008 3:13:00 PM <span style='font-size:10.0pt;
font-family:Arial'>Dear Friend,<o:p></o:p>
<span style='font-size:10.0pt;
font-family:Arial'><o:p> </o:p>
<span style='font-size:10.0pt;
font-family:Arial'> I am having two XML files. I would like to
compare the hierarchy of elements & its attributes and throws the
difference in a error file. I don’t want to compare the content.
Heirarchy of elements in both the XML files should match.<o:p></o:p>
<span style='font-size:10.0pt;
font-family:Arial'><o:p> </o:p>
<span style='font-size:10.0pt;
font-family:Arial'>Here is an example:<o:p></o:p>
<span style='font-size:10.0pt;
font-family:Arial'><o:p> </o:p>
<span style='font-size:10.0pt;
font-family:Arial'>File 1:<o:p></o:p>
<span style='font-size:10.0pt;
font-family:Arial'><?xml version=”1.0”?><o:p></o:p>
<span style='font-size:10.0pt;
font-family:Arial'><html><o:p></o:p>
<span style='font-size:10.0pt;
font-family:Arial'><body><o:p></o:p>
<span style='font-size:10.0pt;
font-family:Arial'><fm><o:p></o:p>
<span style='font-size:10.0pt;
font-family:Arial'><p>This is a simple <st1:place w:st="on">Para</st1:place></p><o:p></o:p>
<span style='font-size:10.0pt;
font-family:Arial'><list><o:p></o:p>
<span style='font-size:10.0pt;
font-family:Arial'><li>This is a simple <st1:place w:st="on">Para</st1:place></li><o:p></o:p>
<span style='font-size:10.0pt;
font-family:Arial'></list><o:p></o:p>
<span style='font-size:10.0pt;
font-family:Arial'></fm><o:p></o:p>
<span style='font-size:10.0pt;
font-family:Arial'></body><o:p></o:p>
<span style='font-size:10.0pt;
font-family:Arial'></html><o:p></o:p>
<span style='font-size:10.0pt;
font-family:Arial'><o:p> </o:p>
<span style='font-size:10.0pt;
font-family:Arial'>File 2:<o:p></o:p>
<span style='font-size:10.0pt;
font-family:Arial'><?xml version=”1.0”?><o:p></o:p>
<span style='font-size:10.0pt;
font-family:Arial'><html><o:p></o:p>
<span style='font-size:10.0pt;
font-family:Arial'><body><o:p></o:p>
<span style='font-size:10.0pt;
font-family:Arial'><fm lang=”es”><o:p></o:p>
<span style='font-size:10.0pt;
font-family:Arial'><p>This is a <strong>simple</strong> <st1:place w:st="on">Para</st1:place></p><o:p></o:p>
<span style='font-size:10.0pt;
font-family:Arial'><p>This is a simple <st1:place w:st="on">Para</st1:place></p><o:p></o:p>
<span style='font-size:10.0pt;
font-family:Arial'></fm><o:p></o:p>
<span style='font-size:10.0pt;
font-family:Arial'></body><o:p></o:p>
<span style='font-size:10.0pt;
font-family:Arial'></html><o:p></o:p>
<span style='font-size:10.0pt;
font-family:Arial'><o:p> </o:p>
<span style='font-size:10.0pt;
font-family:Arial'>Difference between the 2 files are:<o:p></o:p>
Strong tag with <p><o:p></o:p>
<list> has been coded as
<p><o:p></o:p>
lang attribute added in
<fm><o:p></o:p>
<span style='font-size:10.0pt;
font-family:Arial'><o:p> </o:p>
<span style='font-size:10.0pt;
font-family:Arial'><o:p> </o:p>
<span style='font-size:10.0pt;
font-family:Arial'>Regards,<o:p></o:p>
<span style='font-size:10.0pt;
font-family:Arial'>Kumar V.<o:p></o:p> | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
