[thelist] RE: [ - Examples of Importing XML into Netscape or Mozilla? - ]

Haag, Jason haagj at ctcgsc.org
Wed May 22 10:11:09 CDT 2002


I have recently been successful in importing XML into both browsers. The
reason why
the browsers were returning different lengths and a major and very important
difference is that Netscape and Mozilla report the whitespace nodes
(newlines) after each tag; IE does not. Netscape/Mozilla does that because
XML requires
strict whitespace handling.

I shouldn't say the strict whitespace handling is the source of the
problems, but the key to successful cross-browser implementation when
importing XML. To make code more efficient
would you could try setting the preserveWhiteSpace property in IE = false
during the object detection.

Also, there are major differences between the way you access the nodes in
Netscape/Mozilla versus IE:
Most examples I have seen demonstrate IE using .text versus .NodeValue
Does netscape follow the DOM standard way to access the nodeValues in an xml
document? Or does IE deviate from the standard?
There is a universal way to access the nodes. Both browsers claim the
support the DOM!

For example:
Internet Explorer >  objNode.item(0).childNodes(0).text (WRONG)
Netscape / DOM Standard      >  objNode.item(0).childNodes(0).nodeValue

You should use nodeValue in both.


This is the only way I have been able to grab the value, but it forces me to
create a conditional based on object detection
if you don't use nodeValue.

For example:
Netscape > if
(document.implementation&&document.implementation.createDocument)
IE > else if (window.ActiveXObject)

This topic is also being discussed at netscape.public.mozilla.xml
If anyone is interested . . .




--__--__--

Message: 27
From: "Haag, Jason" <haagj at ctcgsc.org>
To: "'thelist at lists.evolt.org'" <thelist at lists.evolt.org>
Date: Tue, 21 May 2002 10:33:50 -0500
Subject: [thelist] [ - Examples of Importing  ML into Nutscrape or Mozilla?
-  ]
Reply-To: thelist at lists.evolt.org




Seriously, are there any websites that actually have working examples of
importing xml into a page using Netscape? I read about  many theoretical
implementations, but
no practical demos for developers.

When I run alerts for debugging, Netscape 6.2 doesn't even return the proper
length.
http://www.tempohomes.net/xml/test/CrossBrowserXMLTest.html

Try this in IE, and Try it in Netscape. Each browser returns two different
lengths. Which one is correct??
This is a primary example of what I'm talking about. If both DOM and full
xml support are provided, why is there still such inconsistency?



--__--__--





More information about the thelist mailing list