I have two database pages that are stored as HTML. One is some XML, the other some XSL. The XML references the XSL as a stylesheet. If I load this XML directly via the browser from a local file, it is automatically transformed. If I load the page from the Domino server, the XSL is never processed. I think the XSL is accessible, but its hard to tell. Is it possible to force the browser to process the XML automatically in this case? Or is it necessary to do the transform on server side first, or explicitly on the browser with JS? Thanks.
Subject: XSL transform in the browser
First off, server side transformation sounds like a much better idea to me. Browsers are meant to render (x)html and css. XSLT support is completely absent in older browsers. IE5.x does have the ability to deal with it in theory, but it requires a different, pre-standardization syntax, so it’s effectively out.
The cause of your actual problem might simply be the content type of your pages. Try setting it to “text/xml” instead of HTML (or maybe even “application/xml”, if this doesn’t work).
Subject: RE: XSL transform in the browser
Modern browser support for this seems quite good. Since this is an internal application only and is guaranteed IE6+, backward compatability is not a problem.
I tried adding “Content-type: text/xml” to the top of the page. This is all that is needed to make an XMLHTTP object interpret the XML correctly, but didn’t seem to work. Changing the page “Content type” setting to “Other” with text/xml didn’t work either. Using application/xml produced the same result.
If you view the page source, it looks like straight XML, but the browser is rendering it as text.
Any more suggestions how to force the page to be treated correctly? Thanks for your help.
Subject: RE: XSL transform in the browser
Adding Content-type to the xml itself should not be required nor do any good. I would have expected the content type setting of the page to be the problem.
Do yourself a favor and give it a go with Firefox. First, it has the error console that will display quite amount of information in pretty plain English and second it has extensions like Firebug or LiveHTTPHeader which allow you to check, what content type Domino REALLY used when serving the pages.
First make sure that Firefox can display the page correctly from the local file system. If not, you might have caught the old proprietary notation used in IE5, which IE6 still understands for compatibility reasons, but which you should definitely not use for new development.
Subject: RE: XSL transform in the browser
Firefox is not a possibility unfortunately.
Well, it seems to be working as expected now. Unfortunately, I don’t know what I changed… Thanks for your suggestions.
Subject: RE: XSL transform in the browser
I didn’t suggest to switch users to Firefox, but you while you are developing. I might be an idiot, but not so much of an idiot.
Even if you’re at a customers site, tell them that there is a free tool you need.
However, good to hear it is working now, not so good that we don’t know why. I would hope for that the page doctype change really did it, but maybe browser caching made it look like it didn’t at first.