By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,447 Members | 1,172 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,447 IT Pros & Developers. It's quick & easy.

XML browser support

P: n/a
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"
xsi:schemaLocation="newspagedef.xsd">

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

<highlight>...</highlight>
</page>

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!
Ben
Apr 14 '07 #1
Share this Question
Share on Google+
4 Replies


P: n/a
benben <benhonghatgmaildotcom@nospamwrites:
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!
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.

sherm--

--
Web Hosting by West Virginians, for West Virginians: http://wv-www.net
Cocoa programming in Perl: http://camelbones.sourceforge.net
Apr 14 '07 #2

P: n/a
On Apr 14, 4:48 am, benben <benhonghatgmaildotcom@nospam>
wrote:
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?
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.
I'm not sure about the browser support status of direct
XML display though, that's why I want to hear from you
guys!
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

Apr 14 '07 #3

P: n/a
p.*****@ctncorp.com wrote:
On Apr 14, 4:48 am, benben <benhonghatgmaildotcom@nospam>
wrote:
>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?

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.
>I'm not sure about the browser support status of direct
XML display though, that's why I want to hear from you
guys!

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
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?

Ben
Apr 18 '07 #4

P: n/a
On Apr 18, 2:19 pm, benben <benhonghatgmaildotcom@nospam>
wrote:
p.le...@ctncorp.com wrote:
On Apr 14, 4:48 am, benben
<benhonghatgmaildotcom@nospamwrote:
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?
Generally, it's not.

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?
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

Apr 18 '07 #5

This discussion thread is closed

Replies have been disabled for this discussion.