xml-xalan-j-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hall, Joe" <Joe.H...@Avnet.com>
Subject RE: xslt layout
Date Wed, 19 May 2004 18:10:29 GMT
Is it possible to use different custom stylesheets (layouts)?  You can use xsl:include to create
a "TemplateMethod" type of xsl for this layout system.  I did something similar with my current

Example LayoutTemplate.xsl (Contains common xslt):
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
	<xsl:include href="header.xsl"/>
	<xsl:include href="footer.xsl"/>
	<xsl:template match="/">
			<!-- a bunch of stuff -->
			<xsl:call-template name="header"/>
			<xsl:call-template name="menu-section"/>
			<xsl:call-template name="content-section"/>
			<xsl:call-template name="footer"/>

Example CustomLayout.xsl (Contains page/client specific formatting):
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
	<xsl:output method="html" indent="yes"/>
	<xsl:template name="menu-section">
		<!-- do stuff custom for this layout -->
	<xsl:template name="content-section">
		<!-- do stuff custom for this layout -->
	<xsl:include href="LayoutTemplate.xsl"/

I would keep the xml pure data and use xslt to provide the XHTML formatting.  This will make
using the same model easier for different views (html, wml, custom app, etc...).

I hope this helps.

Joe Hall

-----Original Message-----
From: Nicolas [mailto:nl@bregenzer.org]
Sent: Wednesday, May 19, 2004 3:40 PM
To: Joseph Kesselman
Cc: xalan-j-users@xml.apache.org
Subject: Re: xslt layout

Joseph Kesselman wrote:

>I'm not entirely sure what you mean by "layout systems"... but it sounds
>like you may asking about XSL Formatting Objects (XSL-FO), which is an XML
>language that describes how information should be arranged on the
>page/screen/whatever. You'd use XSLT to represent your document's contents
>as an XSLFO document, then use an XSL-FO renderer such as FOP to convert
>that into the displayed format.
maybe you hit the right point but as far as i know XSL-FO does not 
produce XHTML (which will be the main output)
i give an example
if have a layout

----------------- topnavigation----------------
menuitem           content

i want to send the xml document which describes layout (not the xslt)
in that layout i include the current xml content.
for example

in java i want to choose my layout

then i modifiy it
the content

i want to send this document to the client
including the processing instruction for the xslt.

my problem is that the stylesheet consists of the standard layout
AND the specific layout for the current content. how can i merge
those xslt descriptions or is this a wrong approach. ?

regards nicolas

View raw message