RE: RE: [xsl] tableheader sort on date with DOM dynamically and o ptimisation xslt/xml code solution

Subject: RE: RE: [xsl] tableheader sort on date with DOM dynamically and o ptimisation xslt/xml code solution
From: "Braumüller, Hans" <h.braumueller@xxxxxxxxxxxx>
Date: Mon, 8 Apr 2002 11:48:05 +0200
Hi,

i found an workaround if i use in the xml instance source:

<row>
	<header name="bspnr"  format="text">Bank</header>
	<header name="date" format="date">Date</header>
	<header name="gspnr" format="number">Amount</header>
	<header name="isocode" format="text">Currency</header>
</row>

<row id="r1">
	<bspnr id="r1_c0">a</bspnr>
	<date id="r1_c1"  date="20021212">12.12.2002</date>
	<gspnr   id="r1_c2">47122</gspnr>
	<isocode id="r1_c3">EUR</isocode>
	
</row>

sending the date in a attribute as number

and then in the script

else if(format == 'date') {
//	alert (format);
datatype.text ="number";
format = "number";
var field = "date/@date";
}		
		

The other option is

without the date attribute in the xml-string putting in the script:

else if(format == 'date') {
	datatype.text ="number";
	format = "number";
	var field = "concat(substring(date, 7,4),substring(
date,4,2),substring(date, 1,2))";
	}	
	
Thank you,

Please excuse my beginner questions.

Hans Braumüller
Mail Art not War
http://identidad-globalizacion.crosses.net


> -----Ursprüngliche Nachricht-----
> Von: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]Im Auftrag von Carsten
> Klein
> Gesendet: Samstag, 6. April 2002 20:04
> An: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Betreff: Re: [xsl] tableheader sort on date with DOM dynamically and
> optimisation xslt/xml code
> 
> 
> Hi Hans,
> 
> well, i don't take the roses...
> 
> First of all you should enclose code inside your script elements in
> your stylesheet inside
> a CDATA section
> 
> <script><![CDATA[
> ...your script
> ]]>
> </script>
> 
> have a look at http://www.w3.org/TR/2001/WD-xslt11-20010824/
> for a detailed description of cdata sections.
> 
> A dynamic sort based on the date is easy to implement, once you have
> figured out how to pass dates to a stylesheet
> 
> Take this code snippet to provide you with a transformation function
> (in javascript, i'm sorry) with arbitrary parameters passed to a
> stylesheet
> 
> You will need to modify your stylesheet accordingly.
> 
> E.g.
> 
> <xml ...>
> <xsl:stylesheet ...>
>     <xsl:param name="sortByDate"/>
> ...
> 
> You may find more information in (including example code)
> my message of march the 23rd
> 
> http://www.biglist.com/lists/xsl-list/archives/200203/msg01009.html
> 
> Bye
> Carsten
> 
> 
> _________________________________________________________
> Do You Yahoo!?
> Get your free @yahoo.com address at http://mail.yahoo.com
> 
> 
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> 

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


Current Thread