Skip to main content
gamedev.net
🔒 Locked

XSL

Started by superpig 4 replies 200+ views
Original Post
superpig
superpig
I''m just reading the W3C Specification for XSL, and from what I''ve read so far it looks like this is a way of formatting XML documents into HTML (or other XML-compatible formats). Has anyone here used it who could tell of their experiences with it? I just wonder... if a forum could be developed where the output is XML, formatted by XSL into HTML for web browsers but kept as XML for other devices (such as an offline client). Superpig - saving pigs from untimely fates, and when he''s not doing that, runs The Binary Refinery.
Richard "Superpig" Fine - saving pigs from untimely fates - Microsoft DirectX MVP 2006/2007/2008/2009
"Shaders are not meant to do everything. Of course you can try to use it for everything, but it's like playing football using cabbage." - MickeyMouse
Big B
Big B
Thats pretty much it. You can also use XSL:FO to convert your documents to PDF. Pretty handy stuff.

You could do a forum like that, where it returns a different stylesheet depending on what they are browsing with. You''d pretty much have to considering IE5.5 and below has a "broken" implementation of XSL and a lot of people still browse with it.



50% of people are below average.
superpig
superpig
Drat. Hmm...

In any case, it would be a good technology to use for the GDForum client, methinks. It would mean that the app would require IE6/XP.. but it would save me having to write a template-parsing system (which I really don''t want to have to do).

The ideas they are aplenty...

Superpig
- saving pigs from untimely fates, and when he''s not doing that, runs The Binary Refinery.
Richard "Superpig" Fine - saving pigs from untimely fates - Microsoft DirectX MVP 2006/2007/2008/2009
"Shaders are not meant to do everything. Of course you can try to use it for everything, but it's like playing football using cabbage." - MickeyMouse
Origin
Origin
quote:
Has anyone here used it who could tell of their experiences with it? I just wonder... if a forum could be developed where the output is XML, formatted by XSL into HTML for web browsers but kept as XML for other devices (such as an offline client).

That''s perfectly possible. In fact you wouldn''t use XSL, but XSLT (XSL for Transformations), in which you can express stylesheets that are able to transform your XML to either HTML (different styles are possible), WML, plain text, RTF, or whatever you can think of.

The only drawback: Most XSLT processor engines integrated into most modern browsers are not bug-free. And especially the older browser don''t support transforming XML content at all.

What you would need is an XSLT processor which transforms all of your XML server-side. With newer versions of PHP, for example, comes the Sablotron XSLT engine. It can only output UTF-8-encoded content at the moment, but besides that, it supports everything you would need to transform XML to HTML.

You could store your forum in a database and then have your forum software generate XML that can either be send to a client directly or be transformed to HTML/CSS before.

By the way, I do all my web pages with XML/XSLT. It eliminates the need of templates and keeps maintenance cost to a minimum.
Arild Fines
Arild Fines
Relying on doing the XSL transformations browser side is not a viable option currently, and it may never be. Doing it server side is pretty much the only way to go.



"The fact that a believer is happier than a skeptic is no more to the point than the fact than a drunken man is happier than a sober one." -- George Bernhard Shaw
--AnkhSVN - A Visual Studio .NET Addin for the Subversion version control system.[Project site] [IRC channel] [Blog]
superpig
superpig
As far as the GDForum client goes, server-side XSLT would be a matter for the GDNet staff. I don''t know what their stance on this is.

But otherwise - are you sure that Sablotron is included with PHP? I downloaded PHP 4.0.3 yesterday and spent a half-hour configuring it (starting with all the options and removing them until it configures successfully), and the --with--XSLT stuff didn''t work.

Superpig
- saving pigs from untimely fates, and when he''s not doing that, runs The Binary Refinery.
Richard "Superpig" Fine - saving pigs from untimely fates - Microsoft DirectX MVP 2006/2007/2008/2009
"Shaders are not meant to do everything. Of course you can try to use it for everything, but it's like playing football using cabbage." - MickeyMouse

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.