[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: xsl:sort Please Help

Subject: RE: xsl:sort Please Help
From: Paul_B_Grimes@xxxxxxxxxx
Date: Thu, 28 Jun 2001 15:50:44 -0700
xsl sort javascript
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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.