#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2003
    Posts
    240
    Rep Power
    44

    How to output quotes?


    Hi all

    I can't figure out (and I've searched) how to use quotes in XSL within values. For example:

    The following outputs a link that, when clicked, does a JS alert. But I need to wrap the contents of the alert in quotes, as it's a string. I've tried escaping ala other languages, i.e. with the backslash, and also using the quote entity &quot. No joy. Where am I going wrong?

    Code:
    <a><xsl:attribute name='href'><xsl:value-of select="concat('javascript:alert(TOYS:\n\n',count(toys/toy),');')" /></xsl:attribute>details</a>
    Thanks in advance for any help
    Last edited by mitya; May 6th, 2011 at 10:07 AM.
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2011
    Location
    Abilene, Texas
    Posts
    69
    Rep Power
    6
    Using &amp;quot; does not work for you? Asking since you posted %quot; above. ref
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2003
    Posts
    240
    Rep Power
    44
    Typo - I'm using &quot
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2011
    Location
    Abilene, Texas
    Posts
    69
    Rep Power
    6

    Try this


    Try the following pastebin code: http://pastebin.com/ceC0MbR8

    Moved the javascript outside the <xsl:value-of /> to <xsl:text /> elements. I don't know if that breaks your expectation.
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2003
    Posts
    240
    Rep Power
    44
    Thanks a lot
  10. #6
  11. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2011
    Posts
    42
    Rep Power
    4
    You have the need and the right to spend part of your life caring for your soul. It is not easy. You have to resist the demands of the work-oriented, often defensive, element in your psyche that measures life only in terms of output -- how much you produce -- not in terms of the quality of your life experiences. To be a soulful person means to go against all the pervasive, prove-yourself values of our culture and instead treasure what is unique and internal and valuable in yourself and your own personal evolution.

IMN logo majestic logo threadwatch logo seochat tools logo