Win a copy of Transfer Learning for Natural Language Processing (MEAP) this week in the Artificial Intelligence and Machine Learning forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Paul Clapham
  • Devaka Cooray
  • Bear Bibeault
Sheriffs:
  • Junilu Lacar
  • Knute Snortum
  • Liutauras Vilda
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Piet Souris
Bartenders:
  • salvin francis
  • Carey Brown
  • Frits Walraven

Does NetScape support DOM?

 
Ranch Hand
Posts: 172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a HTML page and a JavaScript file. In the JavaScript file I'm trying to load an XML file to be handled via DOM. It's quite simple. The problem is how to do it in NetScape?
I took a look at some articles and found the following script:
var XMLDocument = document.implementation.createDocument("", "", null);
XMLDocument.load("NomeDoArquivoXML");
It should work well, but it does not.
Maybe there is missing some parameter in the createDocument method.
Bellow is the snippet I coded:
/** This function creates an XML document and loads it with values passed by "XMLString" */
function loadXML(XMLString, IsFreeThreaded)
{
var XMLDocument = (IsFreeThreaded) ? new ActiveXObject("MSXML2.FreeThreadedDomDocument") : new ActiveXObject("MSXML2.DomDocument");
XMLDocument.validateOnParse = true;
XMLDocument.async = false;
if ((XMLString != null) && (XMLString != ""))
{
XMLDocument.loadXML(XMLString);
}
return XMLDocument;
}
/** This function creates an XML document and loads it with values contained in the XML file called "XMLFile". */
function loadXMLFile(XMLFile, IsFreeThreaded)
{
var XMLDocument = (IsFreeThreaded) ? new ActiveXObject("MSXML2.FreeThreadedDomDocument") : new ActiveXObject("MSXML2.DomDocument");
XMLDocument.validateOnParse = true;
XMLDocument.async = false;
XMLDocument.load(XMLFile);
return XMLDocument;
}

I'm I doing the right thing?
Suggestions will be welcome.
Thanks!
Luciano Queiroz
 
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Luciano,
Netscape does not support XML. IE is the only browser which has inbuilt DOM parser.
Thanks,
Rakesh.
 
And will you succeed? Yes you will indeed! (98 and 3/4 % guaranteed) - Seuss. tiny ad:
Two software engineers solve most of the world's problems in one K&R sized book
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic