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 project.
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="/"> <html> <!-- 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"/> </html> </xsl:stylesheet> 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> <xsl:template name="content-section"> <!-- do stuff custom for this layout --> </xsl:template> <xsl:include href="LayoutTemplate.xsl"/ </xsl:stylesheet> 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:[EMAIL PROTECTED] Sent: Wednesday, May 19, 2004 3:40 PM To: Joseph Kesselman Cc: [EMAIL PROTECTED] 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 menuitem menuitem 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 <layout> <menu>item</menu> </layout> then i modifiy it <layout> <menu>item</menu> <content> the content </content> </layout> 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
