Subject: Re: [xsl] 'apply-templates' on parameter of 'call-template' From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx> Date: Sat, 10 Apr 2004 11:26:25 -0400 |
Of all the good suggestions and comments I've received, this one seems to be closest to what I'd like to do, as I'm trying to make some particularly skanky stylesheets written by someone else as nearly 'self-documenting' as I can, and being able to 'separate out' a chunk of data in its own namespace has considerable appeal in terms of cleanliness and clarity.
I'm still missing something though, as the processors don't seem to love your suggestion, at least the way I tried implementing it.
<xsl:template name="test"> ... <xsl:template name="matchable">
Have I overlooked something obvious,
T:\ftemp>type angus.xsl <?xml version='1.0' encoding='iso-8859-1'?>
<xsl:stylesheet version='1.0' xmlns:xsl='http://www.w3.org/1999/XSL/Transform' xmlns:myns="my-namespace" exclude-result-prefixes="myns">
<myns:data1> <p>This is some text</p> <matchable id="123"/> </myns:data1>
<xsl:template match="/"> <xsl:call-template name="test"> <xsl:with-param name="body" select="document('')/*/myns:data1/node()"/> </xsl:call-template> </xsl:template>
<xsl:template name="test"> <xsl:param name="body">no body</xsl:param> <xsl:apply-templates select="$body"/> </xsl:template>
<xsl:template match="matchable"> <p>The value is <xsl:value-of select="@id"/></p> </xsl:template>
<xsl:template match="p"> <p><xsl:apply-templates/></p> </xsl:template>
<p>This is some text</p> <p>The value is 123</p>
-- Public courses: Spring 2004 world tour of hands-on XSL instruction Each week: Monday-Wednesday: XSLT/XPath; Thursday-Friday: XSL-FO Hong Kong May 17-21; Bremen Germany May 24-28; Helsinki June 14-18
World-wide on-site corporate, govt. & user group XML/XSL training. G. Ken Holman mailto:gkholman@xxxxxxxxxxxxxxxxxxxx Crane Softwrights Ltd. http://www.CraneSoftwrights.com/s/ Box 266, Kars, Ontario CANADA K0A-2E0 +1(613)489-0999 (F:-0995) Male Breast Cancer Awareness http://www.CraneSoftwrights.com/s/bc
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] 'apply-templates' on para, Angus McIntyre | Thread | Re: [xsl] 'apply-templates' on para, Angus McIntyre |
Re: [xsl] 'apply-templates' on para, Angus McIntyre | Date | Re: [xsl] 'apply-templates' on para, Angus McIntyre |
Month |