[XSL-LIST Mailing List Archive Home]
[By Thread]
[By Date]
Re: [xsl] Normalize-Space for a template
Subject: Re: [xsl] Normalize-Space for a template From: "Karl J. Stubsjoen" <karl@xxxxxxxxxxxxx> Date: Fri, 2 May 2003 12:54:14 -0700 |
Tom, I tried your approach. It works well. Just wondering though: is there a way to strip spaces from a template that has been called? My example of a URL and QUERY and DISPLAY was a pretty simple one... if this was a much more complicated (involved) template, it seems there must be a way to "STRIP" the spaces from this result. Thoughts? Karl ----- Original Message ----- From: "Passin, Tom" <tpassin@xxxxxxxxxxxx> To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx> Sent: Friday, May 02, 2003 11:34 AM Subject: RE: [xsl] Normalize-Space for a template > [Karl J. Stubsjoen] > > The following template create a URL. One or more line > > returns occur in the > > source as well unwanted spaces. I'm trying to figure out how to use > > "normalize-space" to strip these unwanted spaces. Here is what I have > > tried: > > > > <xsl:template name="makeUrl"> > > <xsl:param name="Display"/> > > <xsl:param name="url"/> > > <xsl:param name="Query"/> > > <a> > > <xsl:attribute name="href"> > > <xsl:value-of select="$url"/>& > > <xsl:value-of select="$Query"/> > > </xsl:attribute> > > <xsl:value-of select="$Display"/> > > </a> > > > > <!-- NORMALIZE THIS STUFF --> > > <xsl:value-of select='normalize-space(.)'/> > > > > </xsl:template> > > > > > > It doesn't work. Any ideas? > > Kindly do not say that it does not work. Say what you started with, > what you actually got, and what you want that is different from that. > For example, you may be seeing the whitespaces yo have embedded in the > stylesheet, but we cannot tell. > > Also, do you not want a "?" rather than a "&" between url and query? > You could use attribute value templates for a more readable syntax - > > <a href='{$url}?{$Query}'> > ... > </a> > > Cheers, > > Tom P > > 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] Normalize-Space for a tem, Passin, Tom | Thread | RE: [xsl] Normalize-Space for a tem, Michael Kay |
Re: [xsl] Can I force XSLT to outpu, Tim Meals | Date | Re: [xsl] document() access. The co, me |
Month |