kiran kumar

kiran kumar

  • 1.1k
  • 1k
  • 254.4k

compare 2 xml files using xslt

Feb 19 2011 3:07 AM

Hello experts,
i am kinda new to xslt and stuff, i wanted to know how to compare two xml files using xslt

this is my file1.xml
<xml>
<employeedetails>
<employee>
<empname>kiran</empname>
<empid>1231</empname>
<emploc>chennai</emploc>
</employee>
<employee>
<empname>kumar</empname>
<empid>1232</empname>
<emploc>chennai</emploc>
</employee>
</employeedetails>
</xml>

this is my file2.xml
<xml>
<employeedetails>
<employee>
<empid>1231</empid>
<empid>1232</empid>
<empid>1233</empid>
</employee>
</employeedetails>
</xml>

can i use like this 
<xsl:if test="document('file2.xml')/employeedetails/employee/empid=document(file1.xml)/employeedetails/employee/empid">
is this the correct approach 
i am new to this xslt stuff 
any help is very much appreciated
thank you

Answers (2)