XSL: escape ' character

A

Angus Parvis

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
 
D

David Carlisle

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,997
Messages
2,570,240
Members
46,830
Latest member
HeleneMull

Latest Threads

Top