[Yanel-dev] mockups and XSLT literal result element stylesheets
Guillaume Déflache
guillaume.deflache at wyona.com
Fri Mar 5 11:15:05 CET 2010
Hi!
When doing mockups it might be useful to start to with a so-called
"literal result element stylesheet" ( cf.
http://www.w3.org/TR/xslt#result-element-stylesheet ).
Instead of an ordinary XSLT stylesheet this is simply a document in the
output format (e.g. HTML) on which one adds an xsl:version attribute on
the root element (e.g. the "html" element): see the diff below for more
details.
This allows to start adding some dynamic things (mainly using
"xsl:value-of" or "xsl:for-each") to a mockup XHTML page more easily.
Sooner or later though you probably will need to move to a full-fledged
XSLT anyway because this form does not support top-level XSLT elements
like "xsl:param". For Yanel this gets problematic as soon as you want to
e.g. access the many XSLT parameters ('language', 'yanel.back2realm',
etc.) that the 'xml' resource-type provides via the BasicXMLResource
Java class.
More generally I think we should think about streamlining the process of
going from an XHTML mockup page with CSS and images to a complete
resource-type: using the 'xml' resource-type already helps, I'll try to
write down some more good practices as I find them!
> --- res-types/user-admin/htdocs/users-groups-matrix-chooser.xsl|(Revision 47943)
> +++ res-types/user-admin/htdocs/users-groups-matrix-chooser.xsl|(Arbeitskopie)
> @@ -1,7 +1,11 @@
> <?xml version="1.0"?>
> +<xsl:stylesheet
> + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
> +>
> + <xsl:param name="language"/>
>
> +<xsl:template match="/">
> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:i18n="http://www.wyona.org/yanel/i18n/1.0"
> - xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xsl:version="1.0"
> >
> <head>
[...]
> </head>
> @@ -29,3 +33,6 @@
> <div id="group-management-root-panel"></div>
> </body>
> </html>
> +</xsl:template>
> +
> +</xsl:stylesheet>
Cheers,
Guillaume
More information about the Yanel-development
mailing list