VERY simple question about Javascript in XSL. One line!

G

Gene Ellis

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!
 
P

Philippe Poulard

Gene said:
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 |
-----------------------
 
P

Patrick TJ McPhee

% 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.
 

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,239
Members
46,827
Latest member
DMUK_Beginner

Latest Threads

Top