RE: XML DOM issues in IE and Opera

"Grant Mackenzie" <[email protected]>
Newsgroups gmane.comp.web.dom.wdf
Message-ID <000501c5e261$79139a00$d8e931ca@featon>
Hi Jim

DOM standard    doc.getElementById('code1');
Whereas the MSXML parser uses nodefromID()
"To reference a node with nodefromID, the node must be typed as ID in
the schema or document type definition (DTD)."

Other differences//

"Firefox does not support DTD validation or any of the other validation
technologies such as W3C XML Schema (WXS) or RELAX NG."
http://www-128.ibm.com/developerworks/web/library/x-ffox15.html?ca=dgr-l
nxw03FFoxXMLP1

Unlike Firefox xml parser
MSXML is a validating parser ....
This is standard xml validator parser practice.
 If not wellformed & valid xml ... halt-abort then throw error
 The type of error is left up to the implementor

Firefox xml parser can not validate so documents must be only well
formed.

var xParser = new ActiveXObject("Msxml2.DOMDocument.4.0");
xParser.validateOnParse = false;

Will result in a xml parse which doesn't try to validate... Like firefox

xParser.resolveExternals = false;
Won't try to resolve the DTD delared entities

A xml parser can read a DTD and know ID without validating
so you can use
 doc.getElementById() -fork- nodefromID()
Without validating


Always instantiate and use MXML4 ... latest version
MSXML3 is old, buggy and out of date
MXML4 contains many bug fixes, there is no excuse for not using it...

I'm not sure what XML parser Opera uses

Take care
Grant




-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf
Of Jim Auldridge
Sent: Sunday, November 06, 2005 1:38 AM
To: [email protected]
Subject: [wdf-dom] XML DOM issues in IE and Opera


I am having a problem working with DOM methods in an XML document in
IE and Opera.

If you go here:
http://www.jaaulde.com/test_bed/XML-DOM/
and click the button at the top, my AJAX library get's and XML
document, and you should see the 5 boxes fill in with appropriate
data.

That data is, in order, the headers returned when the AJAX request
kicked off, the responseText, the data type of the responseXML (should
be object) and the data type of responseXML.getElementById('code1')
(should be object), and the actual value of the text within the
element with ID 'code1'. (the element with the id 'code1' is one of
the error elements in the XML)

The only place this is working correctly is Firefox. So if you want to
see the correct thing, use Fx.

In IE everything is right until the last 2 boxes which are empty and I
get an error saying that the reponseXML document doesn't support the
method getElementById(). In Opera I get the same basic error, but the
second to last box is correct--it says object. So the last box doesn't
work right.

So IE and Opera are not recognizing reponseXML as a XML document, or
at least not fully supporting the DOM. You can see in the headers that
the correct Content-Type (application/xml) is being sent. And I
manually set at the server to 'text/xml' to see if that was the issue,
but it is not.

Does anyone know what gives?? I have debugged my little heart out.


Unsubscribe
[email protected]

List info
http://www.quirksmode.org/dom/list.html



SPONSORED LINKS Dom perignon Dom pedro lisboa Javascript dropdown menu
Javascript Dom perignon 1990 Javascript scroller



YAHOO! GROUPS LINKS

 Visit your group "wdf-dom" on the web.

 To unsubscribe from this group, send an email to:
 [email protected]

 Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.




------------------------ Yahoo! Groups Sponsor --------------------~--> 
Get fast access to your favorite Yahoo! Groups. Make Yahoo! your home page
http://us.click.yahoo.com/dpRU5A/wUILAA/yQLSAA/9rHolB/TM
--------------------------------------------------------------------~-> 

Unsubscribe
[email protected]

List info
http://www.quirksmode.org/dom/list.html 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/wdf-dom/

<*> To unsubscribe from this group, send an email to:
    [email protected]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.