Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 894747
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T14:26:47+00:00 2026-05-15T14:26:47+00:00

The xml file is having the following structure <?xml version=1.0 encoding=utf-8?> <?xml-stylesheet type=text/xsl href=TestFile.xsl?>

  • 0

The xml file is having the following structure

    <?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="TestFile.xsl"?>
<RootElement>  
  <Date FileModified="7/2/2010 12:54:53 PM" />
  <Child Name="A"/>
  <Child Name="B"/>
  <Child Name="C"/>
  <Child Name="D"/>
  <Child Name="E"/>
</RootElement>

I need to read the date attribute value from the file and pass the to

var d=new Date(  date ); 

Here is my xsl file

<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> 
<xsl:template match="/">
<html>
<head></head>
  <body>
    <center>
      <b>
        <script type="text/javascript">
          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>12)
          {
          curr_hour=curr_hour-12;
          curr_period="PM"
          }
          document.write(d_names[curr_day]+ "&#160;&#160;&#160;&#160;&#160;" +curr_date + "<sup>"+ sup + "  </sup> " + m_names[curr_month] + "&#160;&#160;" + curr_year+ "&#160;&#160;&#160;&#160;&#160;&#160;"+curr_hour+" : "+d.getMinutes()+" : "+d.getSeconds()+" "+curr_period);
        </script>
      </b>
      <xsl:choose>
        <xsl:when test="//Child">
          <br/>
          <br/>
          <br/>
          <b>SampleTable</b>
          <br/>
          <br/>
          <table border="1">
            <tr bgcolor="RGB(0,0,127)" >
              <th width="5">
                <font color="white">S.No</font>
              </th>
              <th width="250">
                <font color="white"> Name</font>
              </th>
            </tr>
            <xsl:for-each select ="//Child">
              <tr>
                <td>
                  <xsl:number value="position()" format="01"/>
                </td>
                <td>
                  <xsl:value-of select="@Name"/>
                </td>
              </tr>
            </xsl:for-each>
          </table>
        </xsl:when >
        <xsl:otherwise ></xsl:otherwise>
      </xsl:choose >
    </center>
  </body >
</html>
</xsl:template>
</xsl:stylesheet>

Is there any way to do this

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T14:26:48+00:00Added an answer on May 15, 2026 at 2:26 pm
    var d = new Date('<xsl:value-of select="RootElement/Date/@FileModified"/>')
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The xml file is having the following structure <Root> <Child value=A/> <Child value=B/> <Child
I have an XML file with the following structure: <Products> <Product name=MyProduct1> <Components> <Component
I'm having a problem writing Norwegian characters into an XML file using C#. I
I'm having a problem with reading and processing a xml file, which I cannot
I am having an issue serializing a c# class to an XML file that
I am having an issue with the following code. It uses the Mini-XML library
I have implement a log4j.xml file having two loggers. Both EventLogger and ErrorLogger logged
This XML file contained archived news stories for all of last year. I was
I get an XML file From a web service. Now I want to get
I have an XML file that starts like this: <Elements name=Entities xmlns=XS-GenerationToolElements> I'll have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.