TECH so is there a CMS that outputs XML/XSL/XSLT instead of HTML/XHTML?

White Stormy

Take that, subspace!
Sep 17, 2002
85,544
Sparkopolis
or anyone have any articles about the advantages of this stuff or performance comparisons or anything else?

it seems awesome.. but I'm having a really hard time finding good info.
 
TS
TS
White Stormy

White Stormy

Take that, subspace!
Sep 17, 2002
85,544
Sparkopolis
Can't you do that with any templating engine?

well I think it would be more than that..

like for drupal.. ANY time drupal outputs any data at all it would need to output xml.

I mean I guess you change drupal to do that.. but it would be a WHOLE lot of changes. if it is that big of a deal, I wonder if it's been talked about at all for drupal 7 :noes:
 

whup

I wish you had children and.. so that I could step
Feb 12, 2007
1,592
Really, why would you want to go XML -> XSLT -> (HTML?) over HTML?

The XSLT is going to have to transform the XML into something, and it's probably going to be HTML.

So why go from Database -> XML -> XSLT -> HTML when you can cut out the XML and XSLT.

One thing I did when AJAX was new is getting the XML from the server and transforming it client-side on the browser into HTML from the XSLT.

This is a nice workflow but has cross-browser problems, and XML and XSLT are poorly tooled and somewhat bloated.

Now there's JSON and the approach of just fetching HTML fragments. They are far simpler and more elegant than XML/XSLT, not to mention better supported in the browsers.
 
TS
TS
White Stormy

White Stormy

Take that, subspace!
Sep 17, 2002
85,544
Sparkopolis
Really, why would you want to go XML -> XSLT -> (HTML?) over HTML?

The XSLT is going to have to transform the XML into something, and it's probably going to be HTML.

So why go from Database -> XML -> XSLT -> HTML when you can cut out the XML and XSLT.

One thing I did when AJAX was new is getting the XML from the server and transforming it client-side on the browser into HTML from the XSLT.

This is a nice workflow but has cross-browser problems, and XML and XSLT are poorly tooled and somewhat bloated.

Now there's JSON and the approach of just fetching HTML fragments. They are far simpler and more elegant than XML/XSLT, not to mention better supported in the browsers.
well it would simplify the drupal functions by having them output ONLY XML, right? and data would be completely separate from presentation..

so making themes would be easier.. you just do one xslt file instead of multiple .tpl.php files, template.php, etc.

I think.
 
Last edited:

whup

I wish you had children and.. so that I could step
Feb 12, 2007
1,592
It sounds good in theory, but consider that you have to create your theme in HTML/CSS; then you have to create the XSLT to transform the XML to that HTML/CSS.

If you change your design you then have to update the XSLT.

It just adds more complication to things and is a real bitch to maintain.

XML in my experience just means more overhead.

I think something you would be more interested in is a way to serialize and deserialize data and responses to XML and JSON, and there's lots of libraries around for doing that.

e.g. you can have your view data object, and different ways of displaying it.

like:

$viewData = new ViewDataObject("Page Title", array("Content1","Content2"));

Then in your Smarty template or whatever:

<html><head><title>{$viewData.PageTitle}
{foreach from=$viewData.Content etc

Then to convert to json:

$json = json_encode($viewData);

You could have a service page returning that for your ajax calls, or put that in a template and get to your view data from javascript:

alert('Page title is ' + viewData.PageTitle);

I'm not sure why you want XML/XSLT but I think in most cases there's way better alternatives.
 
TS
TS
White Stormy

White Stormy

Take that, subspace!
Sep 17, 2002
85,544
Sparkopolis
It sounds good in theory, but consider that you have to create your theme in HTML/CSS; then you have to create the XSLT to transform the XML to that HTML/CSS.

If you change your design you then have to update the XSLT.

It just adds more complication to things and is a real bitch to maintain.

XML in my experience just means more overhead.

I think something you would be more interested in is a way to serialize and deserialize data and responses to XML and JSON, and there's lots of libraries around for doing that.

e.g. you can have your view data object, and different ways of displaying it.

like:

$viewData = new ViewDataObject("Page Title", array("Content1","Content2"));

Then in your Smarty template or whatever:

<html><head><title>{$viewData.PageTitle}
{foreach from=$viewData.Content etc

Then to convert to json:

$json = json_encode($viewData);

You could have a service page returning that for your ajax calls, or put that in a template and get to your view data from javascript:

alert('Page title is ' + viewData.PageTitle);

I'm not sure why you want XML/XSLT but I think in most cases there's way better alternatives.

just learning new things

thanks
 

whup

I wish you had children and.. so that I could step
Feb 12, 2007
1,592
I really like the theory of XML/XSLT too but I think that most people's skills in XSLT is limited, but especially the tools suck.

My previous gen CMS had an AJAX datagrid that allows the client to page through, filter, sort their data with ajax. It gets the data from the server as XML and transforms it client-side via XSLT, into HTML/CSS/Javascript.

It's really snappy and it was great at the time, but it didn't work in some browsers because of the limited XML,XPath,XSLT implementations. And the XSLT stylesheet was hard to handle, + there were issues for things like HTML entities.

It was a good learning experience but I'd never do it that way again. I wouldn't discourage you from learning XSLT and playing with it either, because it's still useful and powerful and something good to have in your toolkit.
 

Users who are viewing this thread

About Us

  • Please do not post anything that violates any Local, State, Federal or International Laws. Your privacy is protected. You have the right to be forgotten. Site funded by advertising, link monetization and member support.
OT v15.8.1 Copyright © 2000-2022 Offtopic.com
Served by fu.offtopic.com

Online statistics

Members online
473
Guests online
68
Total visitors
541

Forum statistics

Threads
369,425
Messages
16,882,824
Members
86,873
Latest member
vitalesan