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

  • Home
  • SEARCH
  • 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 6098439
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T13:09:30+00:00 2026-05-23T13:09:30+00:00

I need to read through the XML file that contains info but one at

  • 0

I need to read through the XML file that contains info but one at a time and display in an HTML page. It needs to appear like its scrolling on its own within the HTML inside a <div> and in form of <p>. Can some one help me out with how to do this?

abc.xml

<?xml version="1.0" encoding="iso-8859-1" ?>

<projects>

<project>
        <flag>1</flag>
        <name>Project 1</name>
        <descp> Short description. </descp>
        <rating> 6 </rating>
        <link> URL1 </link>
        </project>

<project>
        <flag>1</flag>
        <name>Project 2</name>
        <descp> Short description. </descp>
        <rating> 9 </rating>
        <link> URL2 </link>
        </project>

<project>
        <flag>1</flag>
        <name>Project 3</name>
        <descp> Short description. </descp>
        <rating> 4 </rating>
        <link> URL3 </link>
        </project>

<project>
        <flag>1</flag>
        <name>Project 4</name>
        <descp> Short description. </descp>
        <rating> 5 </rating>
        <link> URL4 </link>
        </project>

</projects>

JavaScript:

<script type="text/javascript">
window.onload = timer;

function timer() {
    var xmlDoc=new ActiveXObject("MSXML.DOMDocument");
    xmlDoc.async="false";
    xmlDoc.load("./gsss_hp.xml");
    var projects = xmlDoc.documentElement;
    var project = projects.childNodes(0);
    var numPro = projects.childNodes.length;   // to find number of projects entered in the file

    for(var i=0; i<numPro; i++){
        for(var j=0; j<100000;j++){j+=18; j-=18; for(var z=0;z<5000;z++){}}  /* do noting for nested loops */
        show(i);
    }
}

function show(num) {
    var xmlDoc=new ActiveXObject("MSXML.DOMDocument");
    xmlDoc.async="false";
    xmlDoc.load("./gsss_hp.xml");

    var projects = xmlDoc.documentElement;
    var project = projects.childNodes(num);
    var attr = project.childNodes.length;

    for(var i=0;i<attr;i++){
        var txt = xmlDoc.getElementsByTagName("project")[0].childNodes[i].nodeValue;
        txt = txt + "<br />";
        var idPos;
        if(i==1) { idPos = "name"; }
        else
        if(i==2) { idPos = "descp"; }
        else
        if(i==3) { idPos = "rating"; }
        else
        if(i==4) { idPos = "link"; }

        document.getElementById(idPos).innerHTML = txt;
    }
}

</script>
  • 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-23T13:09:30+00:00Added an answer on May 23, 2026 at 1:09 pm

    While I’ll leave the actual coding to you, the general structure I would use for something like this is:

    • Start off by loading the XML.
    • When the XML is loaded, extract the data into a regular javascript array, to make it easier to handle.
    • Use setTimeout to call draw-function at a specified interval ( http://www.w3schools.com/js/js_timing.asp ) and set a (global) variable to remember which index is the last one displayed.
    • The draw function displays the data, and increments the variable. If == length, reset count.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am parsing through a XML file that's about 12mb big. I need to
i need to read the values from a file(.csv) ,which contains both positive and
I need to read an XML file to a dictionary. I read few guides
I am developing a Chrome extension that needs to package an XML file (a
I have some xml files that will be read-only that I need to access
I need to read through some gigantic log files on a Linux system. There's
I need to read and write some data through named pipes. I have tested
I need to read selected files, matching on the file name, from a remote
I need to read the value of a property from a file in an
I'm writing in C# and trying to represent an XML config file through an

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.