title: How to read Date from an XML file and Parse it using XSL
body: <p>The xml file is having the following structure</p>
  
  <pre><code>    &lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;?xml-stylesheet type="text/xsl" href="TestFile.xsl"?&gt;
  &lt;RootElement&gt;  
    &lt;Date FileModified="7/2/2010 12:54:53 PM" /&gt;
    &lt;Child Name="A"/&gt;
    &lt;Child Name="B"/&gt;
    &lt;Child Name="C"/&gt;
    &lt;Child Name="D"/&gt;
    &lt;Child Name="E"/&gt;
  &lt;/RootElement&gt;
  </code></pre>
  
  <p>I need to read the date attribute value from the file  and pass the to</p>
  
  <pre><code>var d=new Date(  date ); 
  </code></pre>
  
  <p>Here is my xsl file</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="ISO-8859-1"?&gt;
  &lt;xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&gt; 
  &lt;xsl:template match="/"&gt;
  &lt;html&gt;
  &lt;head&gt;&lt;/head&gt;
    &lt;body&gt;
      &lt;center&gt;
        &lt;b&gt;
          &lt;script type="text/javascript"&gt;
            var d_names = new Array("Sunday", "Monday", "Tuesday","Wednesday", "Thursday", "Friday", "Saturday");
            var m_names = new Array("January", "February", "March","April", "May", "June", "July", "August","September","October","November", "December");
  
            var d = new Date(-----------); // here i need to get the date from the xsl file
  
            var curr_day = d.getDay();
            var curr_date = d.getDate();
            var sup = "";
            if (curr_date == 1 || curr_date == 21 || curr_date ==31)
            {
            sup = "st";
            }
            else if (curr_date == 2 || curr_date == 22)
            {
        sup = "nd";
        }
            else if (curr_date == 3 || curr_date == 23)
            {
            sup = "rd";
            }
            else
            {
            sup = "th";
            }
            var curr_month = d.getMonth();
            var curr_year = d.getFullYear();
            var curr_hour=d.getHours();
            var curr_period="AM"
            if(curr_hour&gt;12)
            {
            curr_hour=curr_hour-12;
            curr_period="PM"
            }
            document.write(d_names[curr_day]+ "&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;" +curr_date + "&lt;sup&gt;"+ sup + "  &lt;/sup&gt; " + m_names[curr_month] + "&amp;#160;&amp;#160;" + curr_year+ "&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;"+curr_hour+" : "+d.getMinutes()+" : "+d.getSeconds()+" "+curr_period);
          &lt;/script&gt;
        &lt;/b&gt;
        &lt;xsl:choose&gt;
          &lt;xsl:when test="//Child"&gt;
            &lt;br/&gt;
            &lt;br/&gt;
            &lt;br/&gt;
            &lt;b&gt;SampleTable&lt;/b&gt;
            &lt;br/&gt;
            &lt;br/&gt;
            &lt;table border="1"&gt;
              &lt;tr bgcolor="RGB(0,0,127)" &gt;
                &lt;th width="5"&gt;
                  &lt;font color="white"&gt;S.No&lt;/font&gt;
                &lt;/th&gt;
                &lt;th width="250"&gt;
                  &lt;font color="white"&gt; Name&lt;/font&gt;
                &lt;/th&gt;
              &lt;/tr&gt;
              &lt;xsl:for-each select ="//Child"&gt;
                &lt;tr&gt;
                  &lt;td&gt;
                    &lt;xsl:number value="position()" format="01"/&gt;
                  &lt;/td&gt;
                  &lt;td&gt;
                    &lt;xsl:value-of select="@Name"/&gt;
                  &lt;/td&gt;
                &lt;/tr&gt;
              &lt;/xsl:for-each&gt;
            &lt;/table&gt;
          &lt;/xsl:when &gt;
          &lt;xsl:otherwise &gt;&lt;/xsl:otherwise&gt;
        &lt;/xsl:choose &gt;
      &lt;/center&gt;
    &lt;/body &gt;
  &lt;/html&gt;
  &lt;/xsl:template&gt;
  &lt;/xsl:stylesheet&gt;
  </code></pre>
  
  <p>Is there any way to do this</p>