Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
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 December 11th, 2007, 03:40 PM
Authorized User
 
Join Date: Dec 2007
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default xslt excape charater

I have to compare my variable value to the value #0.0'%'(single quotes is part of the value)

But obviously when i write

<xsl:if test="$myvalue = ' #0.0% ' "> it is not the same as <xsl:if test="$myvalue = ' #0.0'%' ' ">

And <xsl:if test="$myvalue = ' #0.0'%' ' "> throws an error.

Is there an escape character for ' that i can use.

 
Old December 12th, 2007, 05:22 AM
samjudson's Avatar
Friend of Wrox
 
Join Date: Aug 2007
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
Default

You're best bet is probably to do this:

<xsl:variable name="mytest">#0.0'%'</xsl:variable>

<xsl:if test="%myvalue = $mytest">

/- Sam Judson : Wrox Technical Editor -/
 
Old December 12th, 2007, 08:40 AM
Friend of Wrox
 
Join Date: Nov 2007
Posts: 1,243
Thanks: 0
Thanked 245 Times in 244 Posts
Default

With XSLT/XPath 2.0 you can double a quote to escape it e.g.
  
Code:
<xsl:if test="$myvalue = '#0.0''%'''">







Similar Threads
Thread Thread Starter Forum Replies Last Post
General XSLT Questions in the XSLT Forum jminatel BOOK: XSLT 2.0 and XPath 2.0 Programmer's Reference, 4th Edition ISBN: 978-0-470-19274-0 0 March 31st, 2008 07:50 PM
Can XSLT read DTD/schema and Generate XSLT.. ROCXY XSLT 1 November 6th, 2006 09:39 AM
Sorting in SJIS Charater set kribalas SQL Language 0 October 27th, 2006 03:46 AM
dynamic xslt -> xslt creation namespace problem jkmyoung XSLT 2 July 15th, 2006 12:42 AM
Charater support for filesystemobject Shibu Classic ASP Components 1 August 18th, 2004 07:34 AM





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