You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Werner Guttmann <We...@msdw.com> on 2000/07/05 18:32:47 UTC

URL Encoding within stylesheet

Hello,

given the below xml content (retrieved through the use of the XSP SQL
taglib)

<list>
    <processGrp>
        <id>London<id>
        <description>New York EOD</description>
    </processGrp>
    <processGrp>
        <id>New York<id>
        <description>New York EOD</description>
    </processGrp>
</list>

I am building a XSL stylesheet which (amongst other things) should
create an html table with the description as the only column, linking to
another cocoon page. Below is the relevant fragment that builds the <a>
html element. Everything works as long as the id element in the above
xml document does not contain blanks. Unfortunately, this element can
contain data such as "New York" which leaves me with the problem how to
properly encode the string.

 <xsl:template name="bu-link">
     <xsl:param name="processGrpId">London</xsl:param>
         <a
href="bu-sql-page.xml?processGrpId={normalize-space($processGrpId)}"
            target="_blank">
            <xsl:value-of select="."/>
        </a>
    </xsl:template>
<xsl:template match="page">

Can somebody please tell me what I have to use to solve this problem ?

Regards
Werner Guttmann