Trouble Using XMLHttpRequest with XHTML in IE

admin

Administrator
Staff member
Hi,

I am trying to implement what I guess would be considered an HTML templating type of design using XHTML and Javascript. Basically, I would like there to be a flat-file XHTML document which contains all of the HTML needed for the elements in a page. Then, I would like to use the XMLHttpRequest object to retrieve the responseXML of this document, which I can then use to parse out specific elements, manipulate them, and then insert them into the DOM.

However, I am running into a pretty big problem just trying to get IE to recognize the XHTML file and provide the responseXML. I am using the following XHTML DTD in my XHTML file which is named html_template.xml:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

The responseXML seems to be returned fine in Mozilla and I can view the XML DOM tree in the browser. But when I try to view the XHTML template in IE, I receive the following error message:

Use of default namespace declaration attribute in DTD not supported

After looking into this a little further, it seems like IE does not like the seeing the DOCTYPE in the XML source. But if I remove it, the page starts complaining about undefined elements that were previously defined in the DTD.

Does anyone know of a way to formulate XHTML in a way that will make it possible for me to read the responseXML of the page through the XMLHttpRequest object in Javascript? Any help here would be greatly appreciated!

Thanks
 
Back
Top