Re: How to tell users their browser won't work to this XML/XSLT page.

Martin Honnen <[email protected]>
Newsgroups gmane.comp.mozilla.devel.layout.xslt
Organization Liberty Development
Message-ID <[email protected]>

Christopher V. Kimball wrote:

> I have web pags that depend on XML transformations by XSLT.  When a viewer
> with a non-transforming browser tries to view the page, he gets gibberish.
> If he's an expert, he could "Show source" and see comments telling him what
> the problem is.  Unfortunately, most folks with ancient browsers don't know
> how to do this.
> 
> Is there a way to set up the pages to produce an HTML view IF the browser
> doesn't support XML/XSLT?

Well client-side XSLT transformations makes only sense on an intranet 
where you know the browsers support it in my view.
Or at least start with a HTML page and then if possible do the XSLT 
transformation on the client with script, that is possible with Mozilla 
and with IE/MSXML (though APIs are different) and with other browsers 
with proper script object checking you can then tell them that parts 
won't work or better of course provide alternatives.

If the browser has at least XML/XHTML support but no XSLT support then 
you should be able to put XHTML elements in the proper namespace into 
the XML document and the browser should render that e.g.
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="whatever.xml"?>
<root>
   <p xmlns="http://www.w3.org/1999/xhtml">
     If you see this then your browser doesn't support client-side XSLT...
   </p>
   <content>...</content>
</root>
of course your XSLT stylesheet then should make sure it doesn't copy the 
XHTML elements when the processing the XML data.


-- 

	Martin Honnen
	http://JavaScript.FAQTs.com/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.