RE: [xsl] <MsSinceMidnight1Jan1970>1009843200000</MsSinceMidnight1Jan1970>

Subject: RE: [xsl] <MsSinceMidnight1Jan1970>1009843200000</MsSinceMidnight1Jan1970>
From: "Chris Bayes" <chris@xxxxxxxxxxx>
Date: Wed, 17 Apr 2002 20:51:37 +0100
Ok
This is the closest I can get
<?xml version="1.0"?>

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
                version="1.0">
       
 <xsl:output method="html"/>
   
 <xsl:template match="/">
  <html>
   <head>
    <script type="text/javascript">
     function fixupDates(){
alert("here");
	var dvs = document.getElementsByTagName("div");
alert(dvs.length);
        for (var i=0; i &lt; dvs.length; i++){
alert(dvs[i].className);
        	if (dvs[i].className == "fixDate"){
alert("here");
			d=new Date(parseInt(dvs[i].innerHTML));
alert(d.toString());
      			var dd=d.getDate();
      			var mm=d.getMonth()+1;
      			var yy=d.getYear();
alert(dd+"/"+mm+"/"+yy);
			dvs[i].innerHTML = dd+"/"+mm+"/"+yy;
alert(dvs[i].innerHTML);
		}
 	}
     }
    </script>
   </head>
   <body onload="fixupDates()">
    <div class="fixDate"><xsl:value-of select="date"/></div>
   </body>
  </html>
 </xsl:template>

</xsl:stylesheet>

But the result is rather bizarre

<html><body><div><endnote>15/2/102

So you will probably have to do something like
dvs[i].getChildNodes().Item[0].nodeValue = dd+"/"+mm+"/"+yy;
Instead of 
dvs[i].innerHTML = dd+"/"+mm+"/"+yy;
hmmmmmmm

XML/XSL Portal
http://www.bayes.co.uk/xml


> -----Original Message-----
> From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx 
> [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of 
> Dan Diebolt
> Sent: 17 April 2002 20:00
> To: 'xsl-list@xxxxxxxxxxxxxxxxxxxxxx'
> Subject: Re: [xsl] 
> <MsSinceMidnight1Jan1970>1009843200000</MsSinceMidnight1Jan1970>
> 
> 
> >If you use Mozilla, you have a Javascript Console. It tells me 
> >"document.write is not a function". Don't ask me why. It 
> must have to do 
> >with the transformation: If you transform the file 
> externally and open 
> >the HTML file, the result is correct: "2/15/102" (To the 
> year must be 
> >added 1900 in Netscape). 
> 
> I love the cascade of smaller problems!
> 
> How do you even detect the processor/browser? system-property()? Does
> anyone know the usage of this function for NN and IE?
> 
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Tax Center - online filing with TurboTax
> http://taxes.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