This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
problem with multiple xml docs and 1 xsl sheet
- From: "Gene LaCava" <e dot f dot lacava at verizon dot net>
- To: <xsl-list at lists dot mulberrytech dot com>
- Date: Wed, 30 Jan 2002 13:53:23 -0500
- Subject: [xsl] problem with multiple xml docs and 1 xsl sheet
- Reply-to: xsl-list at lists dot mulberrytech dot com
I am so stuck.....
I am trying to print the hours info from an XML file DeptHours.xml and the
emplyee information from another XML file. Can anyone see what I'm doing
wrong ? The employee info comes out fine, but only the Dept_Hours heading
and no detail info for the department hours. The XSL file is below...
Thank You in advance
<?xml version="1.0" ?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" />
<xsl:variable name="hours" select="document('DeptHours.xml')"/>
<xsl:param name="id"/>
<xsl:template match="dataroot">
<HTML>
<BODY>
<TABLE BORDER="2">
<TR>
<TD>Department Hours</TD>
</TR>
<xsl:for-each select="$hours[Dept_Num=$id]">
<TR>
<TD><xsl:value-of select="Dept_Hours1"/></TD>
<TD><xsl:value-of select="Dept_Hours2"/></TD>
<TD><xsl:value-of select="Dept_Hours3"/></TD>
<TD><xsl:value-of select="Dept_Hours4"/></TD>
</TR>
</xsl:for-each>
</TABLE>
<TABLE BORDER="2">
<TR>
<TD>Department Number</TD>
<TD>Department Name</TD>
<TD>Department Phone</TD>
</TR>
<xsl:for-each select="DeptEmployees[Dept_Num=$id]">
<TR>
<TD><xsl:value-of select="Dept_Num"/></TD>
<TD><xsl:value-of select="Dept_Name"/></TD>
<TD><xsl:value-of select="Dept_Phone"/></TD>
<TD><xsl:value-of select="Employee_First_Name"/></TD>
<TD><xsl:value-of select="Employee_Last_Name"/></TD>
<TD><xsl:value-of select="Employee_Title"/></TD>
</TR>
</xsl:for-each>
</TABLE>
</BODY>
</HTML>
</xsl:template>
</xsl:stylesheet>
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list