Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > XSL: escape ' character

Reply
Thread Tools

XSL: escape ' character

 
 
Angus Parvis
Guest
Posts: n/a
 
      08-27-2004
Hi,

how can I escape the ' character in the word "don't"? That's my source:

<xsl:variable name="text.general.ifNotRegistered" select="'If you don't
have a user, please'"/>

Thx ,

Angus
 
Reply With Quote
 
 
 
 
David Carlisle
Guest
Posts: n/a
 
      08-27-2004

To get a ' into an XPath string literal you need to use " to surround
the string as in

"If you don't have a user, please"

then to get that expression into an XML attribute you either delimit
with ' and quote the '

select='"If you don&apos;t have a user, please"'

or delimit with " and quote the "


select="&quot;If you don't have a user, please&quot;"

Or for most purposes you can use the aternaive form using content not an
attribute and not have to quote anything


<xsl:variable name="text.general.ifNotRegistered"
>If you don't have a user, please</xsl:variable>


David


 
Reply With Quote
 
 
 
Reply

Thread Tools

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to read strings cantaining escape character from a file and useit as escape sequences? slomo Python 5 12-02-2007 11:39 AM
URL Escape Character Problem (Bug in ASP.NET??) =?Utf-8?B?Q29vbEtpd2lCbG9rZQ==?= ASP .Net 1 03-10-2005 10:02 PM
Re: html special character and escape characters knowledgepays@hotmail.com ASP .Net 0 01-27-2005 02:08 AM
RegisterStartupScript / Escape Character George Durzi ASP .Net 0 07-02-2004 07:08 PM
Problem With String Containing JavaScript Escape Character Jeff S ASP .Net 12 11-10-2003 07:19 PM



Advertisments