[XSL-LIST Mailing List Archive Home]
[By Thread]
[By Date]
David Carlisle wrote:
In this example like the others I would need to create a temp file because view.xsl will not be the real filename of the imported stylesheet. It will be a different filename for every URL.
eg.
Both URL's use the same layout, but both have a different 'view', so
<xsl:include href="view.xsl" /> needs to be replaced by <xsl:include href="dothis.xsl" /> or <xsl:include href="dothat.xsl" /> depending on which URL is requested.
I hope that makes sense?
Re: [xsl] XHTML templating (best method)
Subject: Re: [xsl] XHTML templating (best method) From: Kris Leech <krisleech@xxxxxxxxxxxxxxx> Date: Fri, 26 Jan 2007 14:57:28 +0000 |
David Carlisle wrote:
Okay, thanks. So that will not work, not the way I have it anyway.By the way how do relative paths work in includes are they relative to
the template with the include?
You can not have an xsl:include inside a template (your second example
is a syntax error).
I just used [FILE] to show that the first example was one file (two files merged in to one) and the second example was two seperate files. I should have pointed that out. They where not supposed to be part of the XSLT code.
Are there any gotcha's in my reasoning below, other than that they both require creating a temporary file which would need a random filename.
sorry I didn't understand why you needed a temporary file here, or what
you mean by the [/FILE] syntax.
The usual way of sharing common features such as head and foot amongstSomething like this?
multiple stylesheets is you put teh common features in a common
stylesheet and each of the page-specific stylesheets import teh common
core (with the import being a top level instruction, not inside a
template)
[FILE] <xsl:include href="view.xsl" /> <xsl:template match="/"> <html> <body> <h2>This is the layout</h2> <xsl:template match="/view"> </body> </html> </xsl:template> [/FILE]
[FILE] <xsl:template match="view"> <h3>This the view</h3> <xsl:value-of select="/a"/> <xsl:value-of select="/b"/> </xsl:template> [/FILE]
In this example like the others I would need to create a temp file because view.xsl will not be the real filename of the imported stylesheet. It will be a different filename for every URL.
eg.
abc.com/dothis.htm abc.com/dothat.htm
Both URL's use the same layout, but both have a different 'view', so
<xsl:include href="view.xsl" /> needs to be replaced by <xsl:include href="dothis.xsl" /> or <xsl:include href="dothat.xsl" /> depending on which URL is requested.
I hope that makes sense?
David
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] XHTML templating (best me, David Carlisle | Thread | Re: [xsl] XHTML templating (best me, David Carlisle |
Re: [xsl] XQuery list, Joe Fawcett | Date | Re: [xsl] XHTML templating (best me, David Carlisle |
Month |
Keywords