This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: <MsSinceMidnight1Jan1970>1009843200000</MsSinceMidnight1Jan1970>


This doesn't have anything to do with the XSL aspect of this discussion, but
you should use date.getFullYear() to get the 4-digit year.  It's recomended
anyway, as getYear() is deprecated.

	- Theo

-----Original Message-----
From: Joerg Heinicke [mailto:joerg.heinicke@gmx.de]
Sent: Wednesday, April 17, 2002 2:33 PM
To: xsl-list@lists.mulberrytech.com
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).

Joerg

Dan Diebolt wrote:
> Thanks Chris. However, I am still having problems with Netscape.
> Anyone know why the following will not convert the date in NN6.1
> (it works in IE6)?
> 
> Simple.xml
> <?xml version="1.0" ?>
> <?xml-stylesheet type="text/xsl" href="Simple.xsl"?>
> <date>1013777148640</date>
> 
> Simple.xsl
> <?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>
>    <body>
>     <script language="javascript">
>      date=new Date(<xsl:value-of select="date"/>);
>      var dd=date.getDate();
>      var mm=date.getMonth()+1;
>      var yy=date.getYear();
>      document.write(mm.toString() + "/" + dd.toString() + "/" +
yy.toString());
>      //document.write("hello world");
>     </script>
>    </body>
>   </html>
>  </xsl:template>
> 
> </xsl:stylesheet>


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

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]