XML browser support

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

Hi masterminds of the WWW out there,

I'm wondering if it is a good practice to write pages in (highly
customized) XML with a XSLT stylesheet attached so the users' browsers
can display the transformed HTML, such as the page below? This way the
site is easier to maintain and page size can be dropped dramatically.

Example page:

<?xml version="1.0" ?>
<?xml-stylesheet type="text/xsl" href="mainpagestyle.xsl"?>

<page xmlns="http://mysite.com "
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance "

         <item title="...">...</item>
         <item title="...">...</item>


This way the essential content of the page is maintained in a highly
organized and compact manner and other things like page layout,
navigation, ads, etc can be done in the XSLT stylesheet so they
immediately apply to all pages.

I'm not sure about the browser support status of direct XML display
though, that's why I want to hear from you guys!

Thank you!

Re: XML browser support

Quoted text here. Click to load it

Browser support for XSLT is practically nil.

It's a reasonable approach for server-side processing though. Browser
support isn't an issue for that, assuming of course that valid HTML is
what gets sent to the browser after the XSLT transform.


Web Hosting by West Virginians, for West Virginians: http://wv-www.net
Cocoa programming in Perl: http://camelbones.sourceforge.net

Re: XML browser support

Quoted text here. Click to load it

Generally, it's not. Just a couple of points:

 - user's UA is more likely to grok HTML 4.01 Strict than
   it is to grok XML with XSLT PI;
 - you lose incremental rendering.

There are other problems with this approach as well, so
generally you'd better stay away from it, unless you're
extremely certain you're not pointing it at your foot.

However. Doing pretty much the same thing, but with XSLT
transformation server-side (either on the fly or ahead of
time) is a quite reasonable approach.

Quoted text here. Click to load it

Patchy. Eight or ten years in the future, we might have
XSLT2 support in most common UA's, and then the approach
you describe would be quite an interesting option from the
viewpoint of separating content and presentation. At the
moment, it's 'workable' within limits, especially for
intranet browser-based applications, but largely unsuitable
for deployment in www context.

Pavel Lepin

Re: XML browser support

p.lepin@ctncorp.com wrote:
Quoted text here. Click to load it

Thank you Lepin and Pendley for your kindly replies. Just one more thing
to ask, is it then ok to embed customized XML tags in XHTML and replace
them with a little javascript and CSS?


Re: XML browser support

Quoted text here. Click to load it

No, it's not ok. Support for XHTML across browsers is even
worse than for XML + XSLT combo. Again, if you do that
server-side, that's perfectly ok, as long as you serve
HTML. 4.01. Strict.

Pavel Lepin

Site Timeline