xsl-list
[Top] [All Lists]

Re: The old problem of Javascript, XSL and ampersand...

2005-01-25 03:41:30
can you show us your xsl?
especially the segment that does the javascript?
Vasu
----- Original Message ----- 
From: "ben senior" <ben(_at_)autonomic(_dot_)net>
To: <xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com>
Sent: Tuesday, January 25, 2005 10:37 AM
Subject: Re: [xsl] The old problem of Javascript, XSL and ampersand...


Thanks for the tip Vasu, but I'm afraid that it didn't work. I wrapped 
the javascript code in the template as you suggested, but the browser 
output remains munged... see a sample below... any other ideas?

&lt;script type="text/javascript" 
src="../IM/assets/dialog.js"&gt;&lt;/script&gt;
     &lt;script type="text/javascript" 
src="../IM/IMEStandalone.js"&gt;&lt;/script&gt;
     &lt;script type="text/javascript"&gt;
      var manager = new ImageManager('../IM/','en');

    ImageSelector =
        {
    update : function(params)
         {
            if(this.field &amp;&amp; this.field.value != null)
        {
           this.field.value = params.f_file; //params.f_url
         }
        },

Ben

Vasu Chakkera wrote:

 Ben, <xsl:text disable-output-escaping="yes"> <![CDATA[ if(this.field
 && this.field.value != null)

 ]]>

 Should help you HTH Vasu

 ----- Original Message ----- From: "ben senior" 
<ben(_at_)autonomic(_dot_)net>
 To: <xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com> Sent: Tuesday, 
January 25, 2005
 10:21 AM Subject: [xsl] The old problem of Javascript, XSL and
 ampersand...


As far as I can tell from the lists, there is no way to get an XSL
sheet to output valid javascript, the <>& chars are converted to
&amp; etc...

e.g. if(this.field && this.field.value != null) becomes
if(this.field &amp; &amp; this.field.value != null) which is
invalid JScript.

However, I didn't get any exact matches on the list for this
problem. So that the list contains a definitive and discoverable
answer, can somebody confirm whether or not it is possible to get
an XSL template to emit unescaped characters like "&".

Many thanks,

Ben



--~------------------------------------------------------------------
XSL-List info and archive:
http://www.mulberrytech.com/xsl/xsl-list To unsubscribe, go to:
http://lists.mulberrytech.com/xsl-list/ or e-mail:
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com> 
--~--



 --~------------------------------------------------------------------
 XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
 To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/ or
 e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com> --~--




--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--