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 7691257
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T20:34:52+00:00 2026-05-31T20:34:52+00:00

This is my xml: <?xml version=1.0 encoding=ISO-8859-1?> <?xml-stylesheet type=text/xsl href=movies.xsl?> <root> <Diary> <Event EventName=J.Edgar

  • 0

This is my xml:

<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet type="text/xsl" href="movies.xsl"?>
<root>
<Diary>
<Event EventName="J.Edgar" Classification="2011 Movies" EventStart="2012-03-19T07:00:00+00:00" EventEnd="2012-03-19T08:00:00+00:00" />
<Event EventName="Titanic" Classification="1997 Movies" EventStart="2012-03-19T09:00:00+00:00" EventEnd="2012-03-19T10:00:00+00:00" />
</Diary>
</root>

I have this two options for creating what I need:

  1. <?xml version="1.0" encoding="ISO-8859-1"?>
    
    <xsl:template match="Event">
      <html>
      <body>
      <h2>Best movies</h2>
      <p>Here you can find the top movies ever.</p>
      <table border="1">
        <tr bgcolor="#9acd32">
          <th>Movie</th>
          <th>Year</th>
          <th>Start Time</th>
          <th>End Time</th>
        </tr>
        <tr>
          <td><xsl:value-of select="@EventName"/></td>
          <td><xsl:value-of select="@Classification"/></td>
          <td><xsl:value-of select="@EventStart"/></td>
          <td><xsl:value-of select="@EventEnd"/></td>
        </tr>
      </table>
      </body>
      </html>
    </xsl:template>
    
    </xsl:stylesheet>
    

2.

    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <script type="text/javascript">
            function loadXMLDoc(fName){
                if (window.XMLHttpRequest){
                    xhttp=new XMLHttpRequest();
                } else {
                    xhttp=new ActiveXObject("Microsoft.XMLHTTP");
                }
                xhttp.open("GET",fName,false);
                xhttp.send("");
                return xhttp.responseXML;
            }

            xmlDoc=loadXMLDoc("movies.xml");

            function displayEvents(){
                var eventsO = xmlDoc.getElementsByTagName("Event");
                var tableO = document.createElement('table'), newRow, newCell;
                for(i=0; i<eventsO.length; i++){
                    newRow = tableO.insertRow(-1);
                    newCell = newRow.insertCell(-1);
                    newCell.appendChild(document.createTextNode(eventsO[i].getAttribute('EventName')));
                    newCell = newRow.insertCell(-1);
                    newCell.appendChild(document.createTextNode(eventsO[i].getAttribute('Classification')));
                }
                document.body.appendChild(tableO);
            }
            window.onload=displayEvents;
        </script>
    </head>
    <body>

    </body>
</html>

Can you please try to correct me in these codes?

I would like to do the following features:

  1. load an external xml from another site anl not local.

  2. Have the list of movies and that when you press on a movie, a popup or a new page comes up and you have more info about the movie. But how do I create it dynamically so the information in that pop up will stay the same but the name of the movie will change, based on the movie you clicked..?

  3. the match “Event” is working but maybe it’s wrong.. (?)

  • 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-31T20:34:54+00:00Added an answer on May 31, 2026 at 8:34 pm

    There should be an xsl:for-each to display the movies in a loop, as follows:

    <?xml version="1.0" encoding="ISO-8859-1"?>
    
    <xsl:template match="/">
      <html>
      <body>
      <h2>Best movies</h2>
      <p>Here you can find the top movies ever.</p>
      <table border="1">
        <tr bgcolor="#9acd32">
          <th>Movie</th>
          <th>Year</th>
          <th>Start Time</th>
          <th>End Time</th>
        </tr>
    
        <xsl:for-each select="root/Diary/Event">      
            <tr>
              <td><xsl:value-of select="@EventName"/></td>
              <td><xsl:value-of select="@Classification"/></td>
              <td><xsl:value-of select="@EventStart"/></td>
              <td><xsl:value-of select="@EventEnd"/></td>
            </tr>
        </xsl:for-each>
    
      </table>
      </body>
      </html>
    </xsl:template>
    
    </xsl:stylesheet>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I currently have an XML document like this: <?xml version=1.0 encoding=ISO-8859-1?> <?xml-stylesheet type=text/xsl href=./transform.xsl?>
I have an xml file like this one: receipt.xml <?xml version=1.0 encoding=ISO-8859-1?> <?xml-stylesheet type=text/xml
I'm starting using XSLT and write this scipt: <?xml version=1.0 encoding=ISO-8859-1?> <xsl:stylesheet version=1.0 xmlns:xsl=http://www.w3.org/1999/XSL/Transform>
I have the following XML: <?xml version=1.0?> <?xml-stylesheet type=text/xsl href=http://www.test.com/AuditTrail.xsl?> and XSL: <?xml version=1.0
Consider the following XSLT script: <?xml version=1.0 encoding=ISO-8859-1?> <xsl:stylesheet version=1.0 xmlns:xsl=http://www.w3.org/1999/XSL/Transform> <xsl:output method=text encoding=iso-8859-1/>
I have this XML at http://localhost/file.xml : <?xml version=1.0 encoding=utf-8?> <val:Root xmlns:val=http://www.hw-group.com/XMLSchema/ste/values.xsd> <Agent> <Version>2.0.3</Version>
Given this XML: <?xml version=1.0 encoding=utf-8?> <content dataType=XML> <item type=Promotion name=Sample Promotion expires=04/01/2009> <![CDATA[
assuming I got following XML file : <?xml version=1.0 encoding=ISO-8859-1 ?> <MyCarShop> <Car gender=Boy>
Consider the following XML: <?xml version=1.0 encoding=ISO-8859-1?> <catalog> <cd> <title>Empire Burlesque</title> <artist> <name>Bob</name> <surname>Dylan</surname>
I've got an XML file which looks somehow like this: <?xml version='1.0' encoding='UTF-8'?> <?xml-stylesheet

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.