0

See the output below the name contains the apostrophe which breaks the code, how can i use urlencode or something else to fix the issue

Output
'&titel=A&Name=S'Tariq&number=1&ud=1&op=3'

<xsl:text>&amp;titel=</xsl:text>
                <xsl:value-of select="osttitle"/>
                <xsl:text>&amp;Name=</xsl:text>
                <xsl:value-of select="ostName"/>
                <xsl:value-of select="NameJS"/>
                <xsl:text>&amp;number=</xsl:text>
                <xsl:value-of select="ostnumber"/>
                <xsl:text>&amp;ud=</xsl:text>
                <xsl:value-of select="ostudnumber"/>
                <xsl:text>&amp;op=</xsl:text>
                <xsl:value-of select="osnumber"/>
Salman Shaykh
  • 221
  • 5
  • 16

1 Answers1

0

If you can move to XSLT 2.0, the function encode-for-uri() is available.

http://www.w3.org/TR/xpath-functions/#func-encode-for-uri

Michael Kay
  • 156,231
  • 11
  • 92
  • 164
  • http://stackoverflow.com/questions/1103205/xslt-replace-apostrophe-with-escaped-text-in-output see this url, the question is exactly the same but when i call the template it gives me error " xsl text cannot be the child node of call template " – Salman Shaykh Sep 12 '14 at 04:55