[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Implementing an Blogger-style template using XSLT


template blogger
On 2/21/06, publicreg@n... <publicreg@n...> wrote:
> Hi,
>
> I'm trying to implement a Blogger-style templating system and would like
> to get some feedback on whether it's feasible or not. While it's true that
> an XSLT file itself would be a template, some of my users are not keen on
> learning it and I'm trying to strike some middle ground here.
>
> The premise is this:
>
> The template file would be an extension of XHTML and looks like this:
>
<snip/> -------------------------
>
> Then, the data input would come in the form of an XML document that looks
> like this:
>
><snip/> --------------------------
>
>
> Finally, I'd have an XSLT file that uses the 2 files and then translates
> into XHTML code that I can output to the browser.
>
> How, folks? Do you think it's feasible to do this? Would appreciate any
> pointers in the right direction.

I've used essentially this architecture since the days when XSLT was
still a draft standard.  It works very well and with proper design can
have good performance. (Proper design includes many forms of caching.)

Currently we use Apache Cocoon to drive this which gives us a lot of
capabilities, many of which we don't really exploit.  It's probably at
least worth looking at.  In particular you can exploit pipelines to
break complex XSLT down into multiple transformations which often
makes hard XSLT problems a lot easier to code (you don't have to build
up complex variables and re-parse them for some problems) and you can
aggregate multiple XML sources to make context sensitive parsing much
easier.

Depending on your eventual deployment targets (cell phones, print,
other devices?) you may want to go a little more abstract than XHTML
for your mark up language.  XUL, XFORMS or something proprietary
perhaps.Among other things you might be able to keep the language
simpler and easier for the end users; and you can maybe separate the
presentation details from the markup model.

In our case we use a very abstract model and two main XSLT passes. 
The first creates an abstract combined model from the layout model,
the data, authorizations and other context dependant things (eg. do
you need internationalization support?).  The output of smashing all
these things together is still an abstract object model, but one that
maps pretty directly to output, minus any presentation device specific
details.  Depending on the deployment target a second transformation
then takes care of the specific presentation details.

I'd note that you should also plan on exploiting the capabilities of
CSS.  Depending on your needs it might be possible to do everything in
pure XML and CSS in which case things can be a lot simpler.


--
Peter Hunsberger

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.