467,910 Members | 1,701 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,910 developers. It's quick & easy.

XML browser support

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
  • viewed: 2560
Share:
4 Replies
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
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.*****@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
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.

Similar topics

5 posts views Thread by Nancy | last post: by
3 posts views Thread by Michael Hamm | last post: by
reply views Thread by Muthu | last post: by
2 posts views Thread by Steve Mauldin | last post: by
4 posts views Thread by Rob Meade | last post: by
1 post views Thread by balakrishnan.dinesh | last post: by
1 post views Thread by avicalc | last post: by
3 posts views Thread by Robert Howells | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.