|
Subject: Re: [xsl] Can you apply a template match on a copy node? From: Joerg Heinicke <joerg.heinicke@xxxxxx> Date: Mon, 23 Sep 2002 00:44:55 +0200 |
<xsl:template match="myNode">
<html>
<body>
<table>
<tr>
<xsl:call-template name="td">
<xsl:with-param name="attributes" select="@*"/>
<xsl:with-param name="content" select="node()"/>
<xsl:with-param name="width" select="500"/>
<xsl:with-param name="bgcolor" select="red"/>
</xsl:call-template>
</tr>
</table>
</body>
</html>
</xsl:template><xsl:template match="td" name="td">
<xsl:param name="attributes" select="@*"/>
<xsl:param name="content" select="node()"/>
<xsl:param name="width" select="500"/>
<xsl:param name="bgcolor" select="red"/>
<td width="{$width}" bgcolor="{$bgcolor}">
<xsl:apply-templates select="$attributes"/>
<xsl:apply-templates select="$content"/>
</td>
</xsl:template>Hi Joerg,
I'm just experimenting with ways of using xml/xsl. Sure I could use css, but I prefer keeping things clean and maintainable from one file. I'm a great believer in a clear seperation between data and layout, and the simplier I can find ways to control the styling the better, which is why I was hoping to do away with css altogether and use xsl templates for everything.
I'm using a server-side asp transform for the processing, so any use of xsl/xml needs to be very efficient to compete with a pure asp scripted solution.
Mike
--- Original Message ----- From: "Joerg Heinicke" <joerg.heinicke@xxxxxx> To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx> Sent: Sunday, September 22, 2002 8:48 PM Subject: Re: [xsl] Can you apply a template match on a copy node?
Hi Mike,
if you really want to style every <td> in the same way, why don't you want to use CSS?
td { width: 500px; background-color: red; }
If not, what's your processing framework? In Cocoon for example a 2 step transformation would be really easy. More information on xalan:nodeset() you can find at
http://xml.apache.org/xalan-j/extensionslib.html#ex-nodeset.
Regards,could
Joerg
Mike Carlisle wrote:
Hi Joerg,
The reason for wanting to process <td> in a seperate match was that it
Whetherbe used to define a style for <td> in one place, and one place only.
wherethe <td> was in the xml or written by another match I wanted one place
Iit's attributes could be set generically, a bit like using xsl as a css.
I'm not that familar with extensions used in Michael Kay's approach. Am
xsl/xmlright in thinking that to use node-set I need to install something like Xalan.exe, and this will then pass a string back into a node set? How do these extensions effect efficiency of the tranform? I've been told
liketransforms are already fairly processor intensive compared to something
processa pure asp solution, so am a bit reluctent to start complicating the
further with external calls. Dooes anyone know of or have any good bench marks?
Cheers,
Mike
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| Re: [xsl] Can you apply a template , Mike Carlisle | Thread | RE: [xsl] Can you apply a template , Robert Koberg |
| [xsl] Partial Implementation of XIn, W. Eliot Kimber | Date | RE: [xsl] Can you apply a template , Robert Koberg |
| Month |