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
Code:
<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
Code:
<xml>
<employeedetails>
<employee>
<empid>1231</empid>
<empid>1232</empid>
<empid>1233</empid>
</employee>
</employeedetails>
</xml>
this is my xslt
Code:
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<body>
<table border="1">
<xsl:for-each select="document('emp.xml')/*/employee/employeeinf/empid">
<xsl:for-each select="document('employee.xml')/*/employee/empid">
<xsl:if test= "string(document('employee.xml')/*/employee/empid)=string(document('emp.xml')/*/employee/employeeinf/empid)">
<tr>
<td>emp<xsl:value-of select="string(document('employee.xml')/*/employee/empid)"/></td>
<td>emp<xsl:value-of select="string(document('employee.xml')/*/employee/empname)"/></td>
</tr>
</xsl:if>
</xsl:for-each>
</xsl:for-each>
</table>
but i am getting getting only 1 result
i should get the details of 1231 and 1232
but i am getting the resl of 1231