8 Replies Latest reply on Feb 12, 2007 10:09 AM by crazyjoemilan

    XML issue getting _level0.txt

    izzysanime
      Im making a website where the text and images are taken from an XML file. the code runs fine, but I get

      _level0.txt show up where the content is supposed to be. I would appreciate and suggestions.

      // The first step is to activate the XML object
      headlineXML = new XML();
      /*
      With the XML Object now active you must now load an XML foramtted document.
      Any DTD or XLS formatting will be ignored.
      */
      headlineXML.onLoad = myLoad;
      headlineXML.load("database.xml");
      // Before proceeding to far into the program, make sure the XML document has loaded
      // Extract information from the XML file
      function myLoad(ok) {
      if (ok == true) {
      Publish(this.firstChild);
      }

      }


      function Publish(HeadlineXMLNode) {
      if (HeadlineXMLNode.nodeName.toUpperCase() == "BROADCAST") {
      content = "";
      story = HeadlineXMLNode.firstChild;
      while (story != null) {
      if (story.nodeName.toUpperCase() == "STORY") {
      head = "";
      main = "";
      IMG = "";
      ALT = "";
      element = story.firstChild;
      while (element != null) {
      if (element.nodeName.toUpperCase() == "HEAD") {
      head = element.firstChild.nodeValue;
      }
      if (element.nodeName.toUpperCase() == "MAIN") {
      main = element.firstChild.nodeValue;
      }
      if (element.nodeName.toUpperCase() == "IMG") {
      IMG = element.firstChild.nodeValue;
      }
      if (element.nodeName.toUpperCase() == "ALT") {
      ALT = element.firstChild.nodeValue;
      }
      element = element.nextSibling;
      }
      content += "<img src='"+IMG+"'alt='"+ALT+"' width='300' height='225' align='top'><br><br><img src='"+IMG+"' alt='"+ALT+"' width='300' height='225'>br><br> <p align='left' class='style3'>"+HEAD+"</p><p align='left' class='style4'>"+MAIN+"</p>";
      txt.htmltext=content;
      }
      story = story.nextSibling;
      }
      }
      }