Subject: RE: [xsl] Combining call-template with attribute value templates From: "Michael Kay" <mike@xxxxxxxxxxxx> Date: Wed, 9 Feb 2005 19:30:31 -0000 |
You're crying out for XSLT 2.0 and stylesheet functions. Michael Kay http://www.saxonica.com/ > -----Original Message----- > From: Frans Englich [mailto:frans.englich@xxxxxxxxx] > Sent: 09 February 2005 19:11 > To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx > Subject: [xsl] Combining call-template with attribute value templates > > > I find the following code XSLT code clumsy: > > <xsl:variable name="resultPath"> > <xsl:call-template name="fullName" /> > </xsl:variable> > > <a href="{str:encode-uri(concat( 'http://example.com/', > $resultPath, r:testee/r:name ))}" > > <xsl:value-of select="r:testee/r:name"/> > </a> > > In other words, I dynamically create the href attribute with > an attribute > value template, which among other things contains the return > value of the > fullName template. > > What I found clumsy, is that the only reason I use the > xsl:variable is that I > can't squeeze in the template call into the attr val > template. Or how is this > possible? > > Another way could be to use an xsl:attribute construct: > > <a> > <xsl:attribute name="href"> > http://example.com/ > <xsl:call-template name="fullName" /> > <xsl:value-of select="r:testee/r:name" /> > </xsl:attribute> > </a> > > I find it a /bit/ cleaner, but it has one big problem: the > content isn't run > through str:encode-uri(). > > Any ideas? How would you write my initial code snippet in the > cleanest, most > beautiful way while staying functionally equivalent? > > > Cheers, > > Frans
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] Combining call-template with , Frans Englich | Thread | Re: [xsl] Combining call-template w, Frans Englich |
[xsl] Combining call-template with , Frans Englich | Date | Re: [xsl] Combining call-template w, Wendell Piez |
Month |