how to use multiple xml files within one xslt
i have two xml file
userdata.xml
<Users>
<User_Detail>
<last_name>k</last_name>
<first_name>r</first_name>
<office_id>1</office_id>
<current_phone_number>9030044404</current_phone_number>
<title>Administrator</title>
</User_Detail>
<User_Detail>
<last_name>A. Fortman</last_name>
<first_name>k</first_name>
<office_id>1</office_id>
<current_phone_number>9701817788</current_phone_number>
<title>Deputy Administrator</title>
</User_Detail>
officeData.xml
<office>
<officeDataXML>
<Office_ID>5</Office_ID>
<Region_ID>MW</Region_ID>
<Office_Level>RO</Office_Level>
<National>1</National>
<Region>5</Region>
<Physical_Office_Name>Chicago Illinois RO</Physical_Office_Name>
</officeDataXML>
<officeDataXML>
<Office_ID>107</Office_ID>
<Region_ID>SW</Region_ID>
<Office_Level>DO</Office_Level>
<National>1</National>
<Region>6</Region>
<Physical_Office_Name>Texas DO</Physical_Office_Name>
</officeDataXML>
using javascript I am sending first name lastname as parameters in xslt but, result is show using userdata.xml
I am getting Office_ID value as number, using that number I want get Physical_Office_Name from OfficeData.xml
Can you please help me, MY xslt is like this
<?xml version="1.0" encoding="ISO-8859-1"?>
<!-- Edited by XMLSpy® -->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:param name="lname" select="null"/>
<xsl:param name="fname" select="null"/>
<xsl:template match="/">
<table class="stripeMe" width="700" cellpadding="5" cellspacing="1">
<thead>
<tr>
<td>Employee Name</td>
<td>Position</td>
<td>Office</td>
<td>CALL US Extension</td>
<td>Direct Line</td>
</tr>
</thead>
<xsl:for-each select="Users/User_Detail">
<xsl:sort select="title" order="ascending" />
<xsl:sort select="last_name" order="ascending" />
<xsl:choose>
<xsl:when test="$lname!='' and $fname !=''">
<xsl:if test="last_name=$lname and first_name=$fname">
<tr>
<td>
<strong>
<xsl:value-of select="first_name"/> <xsl:value-of select="last_name"/>
</strong>
</td>
<td>
<xsl:value-of select="title"/>
</td>
<td>
<xsl:value-of select="office_id"/>
</td>
<td>
<xsl:value-of select="new_extension"/>
</td>
<td>
<xsl:value-of select="current_phone_number"/>
</td>
</tr>
</xsl:if>
</xsl:when>
<xsl:otherwise>
<xsl:if test="last_name=$lname or first_name=$fname">
<tr>
<td>
<strong>
<xsl:value-of select="first_name"/> <xsl:value-of select="last_name"/>
</strong>
</td>
<td>
<xsl:value-of select="title"/>
</td>
<td>
<xsl:value-of select="office_id"/>
</td>
<td>
<xsl:value-of select="new_extension"/>
</td>
<td>
<xsl:value-of select="current_phone_number"/>
</td>
</tr>
</xsl:if>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</table>
</xsl:template>
</xsl:stylesheet>
please help me
|