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

please help, xsl transformation trouble

Subject: please help, xsl transformation trouble
From: Kyle Polillo <KPolillo@xxxxxxxxxxxxx>
Date: Mon, 9 Jul 2001 11:05:58 -0400
onclick sort
Hello all ,

I am new to xml/xsl and I am trying to make a page that sorts the data in a
row by clicking on the column headline. Something happens and the xsl is
transformed but not correctly, I just end up with a blank page. Any help
would be appreciated.

here is the code:

<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">
<xsl:template match="/">
<HTML>
<HEAD>
<TITLE>test</TITLE>    
	   
	  <STYLE>
          
		  BODY       { margin:0px; background-color: blue; width:
30em;
                       font-family: Arial, Helvetica, sans-serif; font-size:
small; }
          H1         { color: #888833; }
          P          { margin-top: .5em; margin-bottom: .25em; }
          HR         { color: #888833; }
          .cell      { text-align: center; font-size: xx-small; margin-top:
.25em; background-color: #FFFFDD; }
          .headline  { font-style: italic; font-size: xx-small; cursor:hand;
color: #FFFFDD ; text-align: center; background-color: blue; border:1px
outset white }
          .body      { text-align: justify; background-color: #FFFFDD; }
          .dingbat   { font-family: WingDings; font-style: normal;
font-size: xx-small; }
          .id    	 { font-weight: bold; }
          .self      { font-style: italic; }
          
      
         </STYLE>

</HEAD>
 
	   <SCRIPT><xsl:comment><![CDATA[
	    
	   function sort(field)
	   {
          sortField.value = field;
          <!-- set cursor to watch here? -->
          document.innerHTML =
source.documentElement.transformNode(stylesheet);
       }
      
      ]]></xsl:comment></SCRIPT>

      <SCRIPT for="window" event="onload"><xsl:comment><![CDATA[
        stylesheet = document.XSLDocument;
        source = document.XMLDocument;
        sortField = document.XSLDocument.selectSingleNode("//@order-by");
	   
	   

	   ]]></xsl:comment></SCRIPT>

  
  <BODY>
   
  
    <P class="cell">click on any column header to sort data :)</P>
	<TABLE>
	<TR>
	<TD><xsl:apply-templates select="fields"/></TD>
	</TR>
	</TABLE>
    <TABLE border="0" cellspacing="1">
      <THEAD>
        <td bgcolor="#000000"><DIV class="headline"
onClick="sort('CustomerID')">CustomerID</DIV></td>
        <td bgcolor="#000000"><DIV class="headline"
onClick="sort('ContactFirstName')">FirstName</DIV></td>
        <td bgcolor="#000000"><DIV class="headline"
onClick="sort('ContactLastName')">LastName</DIV></td>
		<td bgcolor="#000000"><DIV class="headline"
onClick="sort('BillingAddress')">Address</DIV></td>
		<td bgcolor="#000000"><DIV class="headline"
onClick="sort('City')">City</DIV></td>
		<td bgcolor="#000000"><DIV class="headline"
onClick="sort('StateOrProvince')">State</DIV></td>
		<td bgcolor="#000000"><DIV class="headline"
onClick="sort('PostalCode')">Zip</DIV></td>
		<td bgcolor="#000000"><DIV class="headline"
onClick="sort('Country')">Country</DIV></td>
		<td bgcolor="#000000"><DIV class="headline"
onClick="sort('PhoneNumber')">Phone</DIV></td>
		<td bgcolor="#000000"><DIV class="headline"
onClick="sort('Extension')">Extension</DIV></td>
		<td bgcolor="#000000"><DIV class="headline"
onClick="sort('EmailAddress')">Email</DIV></td>
		<td bgcolor="#000000"><DIV class="headline"
onClick="sort('Card_Number')">Card Number</DIV></td>
		<td bgcolor="#000000"><DIV class="headline"
onClick="sort('Expiration_Date')">Expiration</DIV></td>
		<td bgcolor="#000000"><DIV class="headline"
onClick="sort('Username')">Username</DIV></td>
		<td bgcolor="#000000"><DIV class="headline"
onClick="sort('Password')">Password</DIV></td>
		<td bgcolor="#000000"><DIV class="headline"
onClick="sort('Membership_Date')">Membership Date</DIV></td>
		<td bgcolor="#000000"><DIV class="headline"
onClick="sort('Membership_Term')">Membership Term</DIV></td>
		<td bgcolor="#000000"><DIV class="headline"
onClick="sort('Renewal_Date')">Renewal Date</DIV></td>
		</THEAD>
	    
	    <xsl:for-each select="DATABASE/RECORD" order-by="CustomerID">
<---this is the line I am attempting to transform
	  <tr>
        <td class="cell"><xsl:value-of select="CustomerID"/></td>
        <td class="cell"><xsl:value-of select="ContactFirstName"/></td>
        <td class="cell"><xsl:value-of select="ContactLastName"/></td>
		<td class="cell"><xsl:value-of
select="BillingAddress"/></td>
		<td class="cell"><xsl:value-of select="City"/></td>
		<td class="cell"><xsl:value-of
select="StateOrProvince"/></td>
		<td class="cell"><xsl:value-of select="PostalCode"/></td>
		<td class="cell"><xsl:value-of select="Country"/></td>
		<td class="cell"><xsl:value-of select="PhoneNumber"/></td>
		<td class="cell"><xsl:value-of select="Extension"/></td>
		<td class="cell"><xsl:value-of select="EmailAddress"/></td>
		<td class="cell"><xsl:value-of
select="Credit_Card_Number"/></td>
		<td class="cell"><xsl:value-of
select="Expiration_Date"/></td>
		<td class="cell"><xsl:value-of select="Username"/></td>
		<td class="cell"><xsl:value-of select="Password"/></td>
		<td class="cell"><xsl:value-of
select="Membership_Date"/></td>
		<td class="cell"><xsl:value-of
select="Membership_Term"/></td>
		<td class="cell"><xsl:value-of select="Renewal_Date"/></td>
		
      </tr>
      </xsl:for-each>
	  </TABLE>
	 
	  </BODY>
	  </HTML>
</xsl:template>
</xsl:stylesheet>

 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.