Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > XML > XSLT
Password Reminder
Register
| FAQ | Members List | Calendar | 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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
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
Reply With Quote
  #2 (permalink)  
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
Default

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" />

    </xsl:template>
</xsl:stylesheet>

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 10:25 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.