|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: 'apply-templates' on parameter of 'call-template'
At 14:03 -0400 09.04.2004, G. Ken Holman wrote:
[ ... how to use 'call-template' to 'surround' stylesheet XML ... ] ... address the nodes in the stylesheet using the document function. In outline form: 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. Sablotron crashes (presumably having tried to recurse infinitely), while LibXSLT, Saxon and Xalan all just output the text nodes in the content, as if they'd failed to find any matching templates. With the stylesheet: ==== <?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"> <xsl:output method='html' version='1.0' encoding='iso-8859-1' indent='no'/> <myns:data1> <p>This is some text</p> <matchable id="123"/> </myns:data1>
<xsl:template name="test"> <xsl:param name="body">no body</xsl:param> <xsl:apply-templates select="$body"/> </xsl:template> <xsl:template name="matchable"> <p>The value is <xsl:value-of select="@id"/></p> </xsl:template> <xsl:template name="p"> <p><xsl:apply-templates/></p> </xsl:template> </xsl:stylesheet> ==== I get as output just the string This is some text rather than the <p>This is some text</p> <p>The value is 123</p> that I was hoping for. Have I overlooked something obvious, or is this the expected behavior? Thanks again, Angus -- Business: http://www.nomadcode.com/ Personal: http://www.raingod.com/angus/ Political: http://www.gollum2004.com/
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








