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

Discussion in 'OT Technology' started by White Stormy, Oct 31, 2008.

  1. White Stormy

    White Stormy Take that, subspace!

    Joined:
    Sep 17, 2002
    Messages:
    85,489
    Likes Received:
    70
    Location:
    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.
     
  2. kingtoad

    kingtoad OT Supporter

    Joined:
    Sep 2, 2003
    Messages:
    55,923
    Likes Received:
    11
    Location:
    Los Angeles
    Can't you do that with any templating engine?
     
  3. White Stormy

    White Stormy Take that, subspace!

    Joined:
    Sep 17, 2002
    Messages:
    85,489
    Likes Received:
    70
    Location:
    Sparkopolis
    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:
     
  4. whup

    whup I wish you had children and.. so that I could step

    Joined:
    Feb 12, 2007
    Messages:
    1,603
    Likes Received:
    0
    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.
     
  5. White Stormy

    White Stormy Take that, subspace!

    Joined:
    Sep 17, 2002
    Messages:
    85,489
    Likes Received:
    70
    Location:
    Sparkopolis
    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: Nov 2, 2008
  6. whup

    whup I wish you had children and.. so that I could step

    Joined:
    Feb 12, 2007
    Messages:
    1,603
    Likes Received:
    0
    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.
     
  7. White Stormy

    White Stormy Take that, subspace!

    Joined:
    Sep 17, 2002
    Messages:
    85,489
    Likes Received:
    70
    Location:
    Sparkopolis
    just learning new things

    thanks
     
  8. whup

    whup I wish you had children and.. so that I could step

    Joined:
    Feb 12, 2007
    Messages:
    1,603
    Likes Received:
    0
    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.
     

Share This Page