My XSLT solution works on Firefox, not in IE

P

Peter Laman

Hello,

A webserver I'm writing is accessed both by "browser clients" for
interactive use and by "program clients" that request XML formatted
data. To streamline error handling, the server always returns errors
in XML format, linked to an XSLT stylesheet for browser display. This
way both browsers and programs can be served error messages the same
way.

One of these error content is as follows:

<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="http://notepeter/pow/
protecs.dll/doc?ref=Exception.xsl&fld=tpl"?>
<powxml
generator="Protecs On The Web"
fileversion="4.0"
powurl="http://notepeter/pow/protecs.dll">
<exception
message="Invalid use of keyword.
Token:
%&quot;
ORDER
Line Number: 3Aanvullende informatie over BDE
fout: "
dbierr="$2A12 (Invalid use of keyword.)"
bdetable="N.V.T."
processid="0x000005B0 (Decimaal: 1456)"/>
</powxml>

Firefox handles this perfectly, the linked stylesheet is used to
render the data in XHTML format. However, Internet Explorer 6.0 simply
displays the raw XML tree. Further investigation on the server side
shows that it doesn't even request the stylesheet. However if I
request the stylesheet by entering its URL (http://notepeter/pow/
protecs.dll/doc?ref=Exception.xsl&fld=tpl) on the address bar, it
shows up. So the URL is accessible. The question is: why doesn't IE
even request the stylesheet?
 
M

Martin Honnen

Peter said:
One of these error content is as follows:

<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="http://notepeter/pow/
protecs.dll/doc?ref=Exception.xsl&fld=tpl"?>
Firefox handles this perfectly, the linked stylesheet is used to
render the data in XHTML format. However, Internet Explorer 6.0 simply
displays the raw XML tree. Further investigation on the server side
shows that it doesn't even request the stylesheet. However if I
request the stylesheet by entering its URL (http://notepeter/pow/
protecs.dll/doc?ref=Exception.xsl&fld=tpl) on the address bar, it
shows up. So the URL is accessible. The question is: why doesn't IE
even request the stylesheet?

Is the XML document also served from http://notepeter/?
 
P

pr

Peter Laman wrote:
[...]
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="http://notepeter/pow/
protecs.dll/doc?ref=Exception.xsl&fld=tpl"?> [...]
Firefox handles this perfectly, the linked stylesheet is used to
render the data in XHTML format. However, Internet Explorer 6.0 simply
displays the raw XML tree. Further investigation on the server side
shows that it doesn't even request the stylesheet.
[...]

I believe IE is objecting to the ampersand in the URL. Although XML 1.0
permits ampersands to appear in processing instructions, <URL:
http://www.w3.org/TR/xml-stylesheet> says you must use '&amp;' in that
particular processing instruction.
 
P

Peter Laman

Peter Laman wrote:

[...]
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="http://notepeter/pow/
protecs.dll/doc?ref=Exception.xsl&fld=tpl"?> [...]
Firefox handles this perfectly, the linked stylesheet is used to
render the data in XHTML format. However, Internet Explorer 6.0 simply
displays the raw XML tree. Further investigation on the server side
shows that it doesn't even request the stylesheet.

[...]

I believe IE is objecting to the ampersand in the URL. Although XML 1.0
permits ampersands to appear in processing instructions, <URL:http://www.w3.org/TR/xml-stylesheet> says you must use '&amp;' in that
particular processing instruction.

Thanks. That fixed it for IE,... But Firefox doesn't accept it. I've
changed the URI needed to get the stylesheet in order to make it
acceptable by all browsers and it works now.
 
P

Peter Laman

Peter Laman wrote:

[...]
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="http://notepeter/pow/
protecs.dll/doc?ref=Exception.xsl&fld=tpl"?> [...]
Firefox handles this perfectly, the linked stylesheet is used to
render the data in XHTML format. However, Internet Explorer 6.0 simply
displays the raw XML tree. Further investigation on the server side
shows that it doesn't even request the stylesheet.

[...]

I believe IE is objecting to the ampersand in the URL. Although XML 1.0
permits ampersands to appear in processing instructions, <URL:http://www.w3.org/TR/xml-stylesheet> says you must use '&amp;' in that
particular processing instruction.

Thanks, that fixes it for IE... Unfortenately, Firefox doesn't swallow
the '&amp;', so I've simply changed the URL needed to get the
stylesheet to one that packs all info in a single field.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top