XML Formatting - Easy Question

Discussion in 'Software' started by Frogger90, Nov 26, 2005.

  1. Frogger90

    Frogger90 Private E-2

    I'm new to XML and I'm trying to create a script that reads an ASP file that outputs as XML. The data inside uses the following format:
    Code:
     
    <ChatLog>
    <line>
    <time>11-26-05 5:34 PM</time>
    <name>Bob</name>
    <message>Hello Susan.</message>
    </line>
    <line>
    <time>11-26-05 5:36 PM</time>
    <name>Susan</name>
    <message>Why, hello there.</message>
    </line>
    </ChatLog>
    
    I know the format for the XML file is correct, I'm now trying to figure out how to have the file displayed in the following format:
    Code:
    <b>[ 'DATE' ] 'NAME':</b> 'MESSAGE'<br>
    
    I need the script to update the XML data about 2 times per second using a similar code such as the following:
    Code:
    <script>
    function refresh(){
    setTimeout("refresh()", 500);
    createXML();
    }
    </script>
    
    I feel like I'm so close to the answer, I've tried using an XSL file and got it to format it correctly, but the javascript doesn't execute & refresh like it's supposed to. Is there anyone that could help me with this? I would *greatly* appreciate any/all help you could give. ^_^
     
  2. goldfish

    goldfish Lt. Sushi.DC

    what about using an XSL transformation you apply at the server.

    Are you using ASP Classic or ASP.NET 1.0 or 2.0? :)
     
  3. Frogger90

    Frogger90 Private E-2

    I'm using ASP classic. It's working somewhat better, I think. However, it prints the lines 23 times, not sure why. Here are the links to the files, tell me what you think could be going wrong.

    http://www.pcstudyguide.com/testxml.asp <--view the formatted xml file
    http://www.pcstudyguide.com/testxml.asp?x=2 <--view the unformatted XML file
    http://www.pcstudyguide.com/testxsl.xsl <--view the XSL file
    http://www.pcstudyguide.com/testxml.asp?x=3 <--add a line of chat code to the XML file
    http://www.pcstudyguide.com/testxml.asp?x=1 <--clears the chatlog, in case it gets too long just run this script

    If you need to know any of the source for the files, just let me know. Thanks a lot for the help. :)
     
  4. Frogger90

    Frogger90 Private E-2

    *BUMP*
    Please help, someone has to know the answer to this...
     

MajorGeeks.Com Menu

Downloads All In One Tweaks \ Android \ Anti-Malware \ Anti-Virus \ Appearance \ Backup \ Browsers \ CD\DVD\Blu-Ray \ Covert Ops \ Drive Utilities \ Drivers \ Graphics \ Internet Tools \ Multimedia \ Networking \ Office Tools \ PC Games \ System Tools \ Mac/Apple/Ipad Downloads

Other News: Top Downloads \ News (Tech) \ Off Base (Other Websites News) \ Way Off Base (Offbeat Stories and Pics)

Social: Facebook \ YouTube \ Twitter \ Tumblr \ Pintrest \ RSS Feeds