RE: [xsl] xsl:sort Please Help

Subject: RE: [xsl] xsl:sort Please Help
From: Paul_B_Grimes@xxxxxxxxxx
Date: Thu, 28 Jun 2001 15:50:44 -0700
No, I'm not using WD-xsl.  I'm still a little confused though.  Thank you
for your help and your time.  I am pretty new at this.

The following works fine in my application.
<current_projects>
      <xsl:for-each order-by="+project_title" select="
project[project_title$lt$'Z']" xmlns:xsl="http://www.w3.org/TR/WD-xsl";>
           <project>
               <project_title>
                   <xsl:value-of select="project_title"/>
               </project_title>


                        .
                        .
                        .

So I would think the similar format of this would work.  If I don't have
the name space in there, I am getting an 'Invalid procedure call or
argument' message.
when the name space is there, the table appears  blank.  The above format
using 'order-by="cost" ' works but it sorts by the first digit only.  Could
my javascript be the problem for the sort attribute?
<current_projects>
      <xsl:for-each select="project" xmlns:xsl="
http://www.w3.org/1999/XSL/Transform"; version="1.0">
       <xsl:sort  select="cost" data-type="number"/>
           <project>
                <project_title>
                   <xsl:value-of select="project_title"/>
               </project_title>
                          .
                          .
                          .
               <cost>
                   <xsl:value-of select="cost"/>
               </cost>
                          .
                          .
                          .
Here is some of the code in my html document:

<html>
<body>

<link rel="stylesheet" type="text/css" href="ProjectSorted.css" />
<XML id="xmldso"></XML>
<XML id="sortTitle" src="sortTitle.xslt"></XML>
<XML id="sortProjectNum" src="sortProjectNum.xslt"></XML>
<XML id="sortStartDate" src="sortStartDate.xslt"></XML>
<XML id="sortCompleteDate" src="sortCompleteDate.xslt"></XML>
<XML id="sortCost" src="sortCost.xslt"></XML>
<XML id="sortName" src="sortName.xslt"></XML>
<XML id="sortContactNum" src="sortContactNum.xslt"></XML>

  <SCRIPT language="javascript">


xmldso.async = false;
xmldso.load("project.xml");
var xmldoc = xmldso.cloneNode(true);


function ApplyStyleSheet(xsldoc){

xmldoc.documentElement.transformNodeToObject(xsldoc.documentElement,xmldso.XMLDocument);
}
</SCRIPT>

<table id="table" datasrc='#xmldso' Border="1" bordercolor="steelblue"
bgcolor="steelblue" cellpadding="3" width="100%" align="center">
  <thead> <th>
      <a href="javascript:ApplyStyleSheet(sortTitle.XMLDocument);">Project
Title</a>
    </th>
        <th>
      <a href="javascript:ApplyStyleSheet(sortProjectNum.XMLDocument);">
Project Number</a>
    </th>
        <th>
      <a href="javascript:ApplyStyleSheet(sortStartDate.XMLDocument);">
Start Date</a>
    </th>
        <th>
      <a href="javascript:ApplyStyleSheet(sortCompleteDate.XMLDocument);">
Completion Date</a>
    </th>
        <th>
      <a href="javascript:ApplyStyleSheet(sortCost.XMLDocument);">Cost</a>
    </th>
        <th>
      <a href="javascript:ApplyStyleSheet(sortName.XMLDocument);">Contact
Name</a>
    </th>
        <th>
      <a href="javascript:ApplyStyleSheet(sortContactNum.XMLDocument);">
Contact Number</a>
    </th>
      </thead>


etc.

</body>
</html>


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread