XSL: escape ' character

Discussion in 'XML' started by Angus Parvis, Aug 27, 2004.

  1. Angus Parvis

    Angus Parvis Guest

    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
     
    Angus Parvis, Aug 27, 2004
    #1
    1. Advertising

  2. 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
     
    David Carlisle, Aug 27, 2004
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Niko
    Replies:
    1
    Views:
    8,675
    Mike Brown
    Sep 4, 2003
  2. Replies:
    1
    Views:
    3,613
    A. Bolmarcich
    May 27, 2005
  3. Replies:
    3
    Views:
    1,021
    Joe Kesselman
    Feb 9, 2007
  4. Wizfrog
    Replies:
    1
    Views:
    781
    Martin Honnen
    Jul 25, 2007
  5. slomo
    Replies:
    5
    Views:
    1,546
    Duncan Booth
    Dec 2, 2007
Loading...

Share This Page