Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
| Search | Today's Posts | Mark Forums Read
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old February 27th, 2007, 12:19 AM
Authorized User
Join Date: Feb 2007
Location: , , .
Posts: 39
Thanks: 0
Thanked 0 Times in 0 Posts
Default translate

suppose my nodevalue contain a specific string like'"' i want to transform it to any specific char...like '..

with translate i can remove any char now i want to remove
" with ' ..but i can't put ' directly in the function it is showing error..wat is the escapre sequence for '?
translate($varVal,'"',''')...it is showing error
Old February 27th, 2007, 04:15 AM
Registered User
Join Date: Jan 2007
Location: Reading, , United Kingdom.
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts

Hi Gantait,

You can use variables, for example:

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

    <xsl:variable name="quot">&quot;</xsl:variable>
    <xsl:variable name="apos">&apos;</xsl:variable>
    <xsl:variable name="varVal">&quot; something &quot;</xsl:variable>

    <xsl:template match="/">
        <xsl:value-of select="translate($varVal, $quot, $apos)" /><br />
        <xsl:value-of select="$varVal" />


Similar Threads
Thread Thread Starter Forum Replies Last Post
sum and translate in XPath nwright BOOK: XSLT Programmer's Reference, 2nd Edition 2 December 5th, 2008 08:20 AM
XSL Translate Problem iami XSLT 11 September 5th, 2007 12:51 AM
Can you translate? ms_sheila CSS Cascading Style Sheets 2 May 13th, 2007 08:54 PM
How do you translate an apostrophe? IronStar XSLT 2 November 13th, 2006 12:35 PM
how to translate this coding sime_tyres Pro VB 6 0 January 17th, 2006 09:32 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.