Subject: Re: [xsl] Processing xsl within an included document From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx> Date: Wed, 13 Oct 2004 14:21:29 -0400 |
--- main.xsl --- <xsl:include href="include/header.xsl"/>
[in your template] <xsl:variable name="testvar" select="'hello'" /> <xsl:call-template name="make-header"> <xsl:with-param name="value" select="$testvar"/> </xsl:call-template> Boring main stuff
--- include/header.xsl --- <xsl:template name="make-header"> <xsl:param name="value"/> <page> <header> <h1><xsl:value-of select="$value" /></h1> </header> </page> </xsl:template>
I hope that helps, Wendell
I know that this is something of a FAQ, and I apologize. But I've searched the list archives and googled until the "g" key on my keyboard begged for mercy, and I'm still stuck.
I just can't get my head around processing XSL elements inside an included document.
Here's what I've got now:
--- main.xsl --- <xsl:variable name="testvar" select="'hello'" /> <xsl:copy-of select="document('include/header.xsl')//page/header" /> Boring main stuff
--- include/header.xsl --- <page> <header> <h1><xsl:value-of select="$testvar" /></h1> </header> </page>
...clearly, that's not going to work because the copy-of deep copy thing. The <xsl:value-of...> element is just being included verbatim in the output.
So here's where I'm stuck. It seems like it should be a very straightforward operation, and I've done gymnastics with <xsl:copy> and <xsl:apply-templates/>, but I just can't seem to make it make sense.
====================================================================== Wendell Piez mailto:wapiez@xxxxxxxxxxxxxxxx Mulberry Technologies, Inc. http://www.mulberrytech.com 17 West Jefferson Street Direct Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 ---------------------------------------------------------------------- Mulberry Technologies: A Consultancy Specializing in SGML and XML ======================================================================
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] Processing xsl within an incl, Talley, Brooks | Thread | [xsl] complex "insert" rules; gener, Eric Compas |
[xsl] complex "insert" rules; gener, Eric Compas | Date | [xsl] sorting and preceding-sibling, ethan.kalfus |
Month |