VERY simple question about Javascript in XSL. One line!

Discussion in 'XML' started by Gene Ellis, Jun 23, 2004.

  1. Gene Ellis

    Gene Ellis Guest

    Put simple I would like to have this line in my XSL template:

    document.writeln("<a href='http://www.mydomain.com/user/login.php'
    class='login'>")

    My XML parser seems to be breaking on the single quotes. Do you know
    how I can use double quotes? Or even single quotes? I have tried using
    a backslash, and even tried using their numeric and character values.
    I am really unsure of how to use these things together in the correct
    way. Thank you so much!
    Gene Ellis, Jun 23, 2004
    #1
    1. Advertising

  2. Gene Ellis wrote:
    > Put simple I would like to have this line in my XSL template:
    >
    > document.writeln("<a href='http://www.mydomain.com/user/login.php'
    > class='login'>")
    >
    > My XML parser seems to be breaking on the single quotes. Do you know
    > how I can use double quotes? Or even single quotes? I have tried using
    > a backslash, and even tried using their numeric and character values.
    > I am really unsure of how to use these things together in the correct
    > way. Thank you so much!


    escape " with &quot;
    escape ' with &apos;
    escape < with &lt;
    escape > with &gt;
    escape & with &amp;

    --
    Cordialement,

    ///
    (. .)
    -----ooO--(_)--Ooo-----
    | Philippe Poulard |
    -----------------------
    Philippe Poulard, Jun 23, 2004
    #2
    1. Advertising

  3. In article <>,
    Gene Ellis <> wrote:

    % Put simple I would like to have this line in my XSL template:
    %
    % document.writeln("<a href='http://www.mydomain.com/user/login.php'
    % class='login'>")

    Well, what have you tried? It's difficult to make suggestions without
    any context at all.


    % My XML parser seems to be breaking on the single quotes.

    It seems to be, but it's probably breaking on <. In this case,
    the anchor tag is data, not an XML element, so you need to
    treat it as data. You could try
    <![CDATA[document.writeln("<a href='http://www.mydomain.com/user/login.php'
    class='login'>")]]>

    If that doesn't help, post a short example of what you're trying now.
    --

    Patrick TJ McPhee
    East York Canada
    Patrick TJ McPhee, Jun 25, 2004
    #3
    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. Replies:
    1
    Views:
    3,591
    A. Bolmarcich
    May 27, 2005
  2. Raymond Arthur St. Marie II of III

    very Very VERY dumb Question About The new Set( ) 's

    Raymond Arthur St. Marie II of III, Jul 23, 2003, in forum: Python
    Replies:
    4
    Views:
    456
    Raymond Hettinger
    Jul 27, 2003
  3. shanx__=|;-

    very very very long integer

    shanx__=|;-, Oct 16, 2004, in forum: C Programming
    Replies:
    19
    Views:
    1,595
    Merrill & Michele
    Oct 19, 2004
  4. Peter

    Very very very basic question

    Peter, Feb 8, 2005, in forum: C Programming
    Replies:
    14
    Views:
    506
    Dave Thompson
    Feb 14, 2005
  5. olivier.melcher

    Help running a very very very simple code

    olivier.melcher, May 12, 2008, in forum: Java
    Replies:
    8
    Views:
    2,252
Loading...

Share This Page