I'm having trouble with my AJAX script at http://sloaepi.dyndns.org/brothers/mkosbie/imager.ff.html .  I'm getting the error "Parameter entity must be defined before it is used" when I try to load the responseText into the XML Document container.  The page is setup right now to alert the response text, then alert the error message, then alert the length of the getElementsByTagName array I'm trying to get to.

I'm no expert in XML, but I'm pretty proficient with JS DOM and String manipulation, so I can make the XHTML look like whatever it needs to make this work.
LVL 12
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

The major problem here is that you're trying to load and parse (using loadXML) a HTML document which is not XHTML.
You cannot just change DOCTYPE declaration to XHTML.
See the W3C article about HTML4 and XHTML differences:

The second problem is that Microsoft XML library does not parse XHTML 1.1 DTD:
http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd. I think this is the root cause of getting "Parameter entity must be defined before it is used" messages.
The solution here is to use XHTML 1.0 instead of XHTML 1.1.
The suggested change in parseXML function:
      var re = /(\<\!DOCTYPE[^>]+>)/;
      doc = doc.replace(re, "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">");

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
netsmithcentralAuthor Commented:
I know you can't call HTML XHTML.  They are similar enough though, that if i know what kind of data to expect from the server, I should be able to parse XHTML from HTML.  At any rate, I'm now gettin the error "use of default namespace declaration attribute in dtd not supported".  I googled it, and came up with needing to include the xmlns attribute, so I added that.  No luck.  Any ideas?
Try this:
 doc = doc.replace(/<html>/, '<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">');
It should solve namespace problem.
netsmithcentralAuthor Commented:
Finally got it working (changed the addy to /ieXML.html).  I've decided it's easier to just use text manipulation for any non XML document though.  Thanks!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.