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

XSLT template library creation

Subject: XSLT template library creation
From: sguazt@xxxxxxxxxxx
Date: Tue, 15 Oct 2002 16:45:23 +0200
xslt template library
Hi people!
I'd like to create a XSL template library for producing HTML in
a per-skin way. That is:
suppose you have a multi-skin site; each user is able to select the skin
he likes; the output, e.g. XHTML page, is produced by a XML->XSLT transformation.
My idea is to develop a set of named-templates that abstracts presentation
widgets (table, button, list, ...).
So we have two type of XSL:
1) one that is skin-indepedent (it uses the per-skin XSL template library)
2) one that is skin-dependent (i.e. the per-skin template library)

the number 1) will include the XSL document related to current skin:

<xsl:stylesheet ...>

<xsl:import href="/path/to/current/skin/my_template_lib.xsl" />
...
<!-- use of imported named-templates -->
</xsl:stylesheet>

So here the problems:

complex widget, like tables, may take complex "data" as parameters; e.g:
   call-template name="my:table"
        with-param name="thead" select=??? /
        with-param name="tbody" select=??? /
        with-param name="tfooter" select=??? /
   /call-template

the value for each param may be a RTF (Result Tree Fragment); however, while
it happens that RTF for "tbody" is taken from XML tree (e.g. <xsl:with-param
name="tbody" select="/root/nodes" />"), RTF for "thead" and "tfooter"
have to be just created in XSL sheet; for example something like:
  <xsl:with-param name="thead"
select="create-rtf(text-node('col1_caption'),text-node('col2_caption'))" />

where "create-rtf" and "text-node" functions are hypothetic XSL function :(

Summary:
* there are complex widget that can take complex parameters.
* sometimes it is necessary to create RTF from simple text.

Constraints and goals:
* XSLT 1.0;
* no extension elements (I use Sablotron XSLT processor; currently it supports
  only "func:script" EXSLT extension).
* 1 pass of XML/XSLT processing (i.e. avoid XML->XSLT->XSLT pipeline)
* abstraction and good performance ;)
Any idea ??
Thanx in advance for reading and eventually answering!!!
                                                Marco Guazzone
                                                marco.guazzone@xxxxxxxxxxx
                                                Kerbero S.r.L.


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

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
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.