tags:

views:

86

answers:

2

Hello, I'm learning XSLT and Javascript and I'm trying to load some XSLT generated XHTML using the loadXML() function and I'm getting the following parsing error while using IE (might also be happening in FF to, not sure)...

The server did not understand the request, or the request was invalid. Error processing resource 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'

The line in the XHTML it's stumbling on while parsing must be...

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;

does anyone see anything wrong there?

Thanks so much in advance for all your help!

A: 

The DOCTYPE appears to be correct and the URL for the DTD resolves to the DTD on the W3C site so I don't think there is anything wrong with the document. I assume you have checked that you are online and can access the DTD? If so, I'd suggest you try out some other documents to see what might be wrong in your code or browsers setup.

Sorry I can't be more specific but listing the code might help.

peter.murray.rust
A: 

One possible explanation is that w3.org might be refusing to serve the DTD to you based on your User-Agent string or IP address (or their combination, or something else).

Depending on your exact setup and needs, you could try one of the following:

  • Switch off validating/DTD loading, if you don't need it (and there is a way to disable it), or

  • configure your XML processing system to use a local copy of the DTD instead of fetching it over the network, or

  • omit the DOCTYPE declaration from your XHTML document entirely, or

  • change the system identifier in the DOCTYPE declaration to point to a local copy of the DTD, or

  • configure the system to access the DTD through a HTTP proxy that has it cached and won't refuse to serve it to you.

Jukka Matilainen