Sorry if this is a long post, but I wanted to include all the necessary code! Thanks in advance for any help...
I'm having problems getting the
element to do what I want it to. I'm trying to use XSLT to transform an XML employee list into XHTML. The structure of my XML document is like this:
(Data has been removed due to its sensitive nature). There are multiple
elements per
element, and multiple
elements in the
element. The XSL template I am trying to use looks like this:
You can see that there are two places where
elements have been commented out. If I uncomment the first of those elements, I get the following error message from Internet Explorer (with actual data where this example says DATA_REMOVED):
Unspecified error Line 183, Position 15
I get a similar error when I uncomment the second
element. I'm using Internet Explorer 5.5 SP2 to view this document. Any help you could lend would be greatly appreciated!
Sincerely,
Patrick Correia, Web Designer
Clough, Harbour & Associates, LLP
pcorreia@_NOSPAM_cha-llp.com
I'm having problems getting the
Code:
<xsl:sort/>
Code:
<?xml version="1.0" ?>
<?xml-stylesheet type="text/xsl" href="employees_xsl.cfm"?>
<employees count="">
<SGroup id="" name="">
<employee>
<id></id>
<FName></FName>
<LName></LName>
<Extension></Extension>
</employee>
</SGroup>
</employees>
(Data has been removed due to its sensitive nature). There are multiple
Code:
<employee>
Code:
<SGroup>
Code:
<SGroup>
Code:
<employees>
Code:
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="[URL unfurl="true"]http://www.w3.org/TR/WD-xsl">[/URL]
<xsl:template match="/">
<html>
<xsl:apply-templates/>
</html>
</xsl:template>
<xsl:template match="employees">
<head>
<title>Active Employees</title>
<link rel="STYLESHEET" type="text/css" href="employees.css" />
<script type="text/javascript" src="employees_js.js"></script>
</head>
<body>
<table border="0" cellspacing="0" cellpadding="3">
<col width="30" />
<col width="200" />
<col width="50" align="center" />
<col width="100" />
<thead>
<tr>
<td></td>
<td>Employee Name</td>
<td>EmpID</td>
<td>Extension</td>
</tr>
</thead>
<xsl:apply-templates select="SGroup">
<!-- <xsl:sort select="@name"/> -->
</xsl:apply-templates>
</table>
</body>
</xsl:template>
<xsl:template match="SGroup">
<tbody>
<tr class="SGroup">
<td colspan="4"><a class="showSGroup"><xsl:attribute name="href">javascript:show(<xsl:value-of select="@id"/>);</xsl:attribute><span class="showSGroup">4</span><xsl:value-of select="@name"/></a></td>
</tr>
<tr>
<td colspan="4">
<table border="0" cellspacing="0" cellpadding="3" class="SGroupMembers" style="display:none;"><xsl:attribute name="id">tbl<xsl:value-of select="@id"/></xsl:attribute>
<col width="27" />
<col width="200" />
<col width="50" align="center" />
<col width="97" />
<xsl:apply-templates select="employee">
<!-- <xsl:sort select="LName"/> -->
</xsl:apply-templates>
</table>
</td>
</tr>
</tbody>
</xsl:template>
<xsl:template match="employee">
<tr>
<td></td>
<td><xsl:value-of select="LName"/>, <xsl:value-of select="FName"/></td>
<td><xsl:value-of select="id"/></td>
<td><xsl:value-of select="Extension"/></td>
</tr>
</xsl:template>
</xsl:stylesheet>
You can see that there are two places where
Code:
<xsl:sort>
Unspecified error Line 183, Position 15
Code:
<Extension>DATA_REMOVED</Extension>
--------------^
Code:
<xsl:sort>
Sincerely,
Patrick Correia, Web Designer
Clough, Harbour & Associates, LLP
pcorreia@_NOSPAM_cha-llp.com