xsl-list
[Top] [All Lists]

Re: [xsl] Spaces to %20

2007-07-06 06:36:51
Use the str-map() function/template of FXSL.

See for example test-str-dvc-Map2.xsl:

http://fxsl.cvs.sourceforge.net/fxsl/fxsl-xslt2/Tests/test-str-dvc-Map2.xsl?view=markup

--
Cheers,
Dimitre Novatchev
---------------------------------------
Truly great madness cannot be achieved without significant intelligence.
---------------------------------------
To invent, you need a good imagination and a pile of junk
-------------------------------------
You've achieved success in your field when you don't know whether what
you're doing is work or play


On 7/5/07, Kerry Kobashi <kkobashi(_at_)comcast(_dot_)net> wrote:
Hi all,

I need a way to convert all spaces into %20 for the anchor tag href below:

<xsl:for-each select="/article/keywords/keyword">
  <xsl:variable name="kw" select="."/>
    <a href="/search.php?keyword={$kw}" title="{$kw}">
       <xsl:value-of select="$kw" />
    </a>
  <xsl:if test="position()!=last()">, </xsl:if>
</xsl:for-each>


<?xml version="1.0" encoding="UTF-8"?>
<article>
   <keywords>
      <keyword>Cascading Style Sheet</keyword>
      <keyword>Hypertext Markup Language</keyword>
   </keywords>
</article>


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>