XSL transform not working in Firefox

Z

zakhan

I have an XSL file that uses hiveware_enkoder javascript to hide an
email address.

This is a snippet from the xsl file:

<script type="text/javascript">
//&lt;![CDATA[
function hiveware_enkoder(){var i,x,y,x=
"x='78<snip><snip>286a293b';y='';for(i=0;i&lt;x.length;i+=2){y+=unescape('%'+x.sub"
+
"str(i,2));}y";
while(x=eval(x));}hiveware_enkoder();
//]]&gt;
</script>

This renders absolutely fine under Internet Explorer but the XSLT
processor in Firefox just hangs when it reaches the code above.

Any ideas what's going on? Any help would be appreciated (even if it's
just a wild guess). At this point, I'm out of ideas on how to debug
this problem :(

Thanks.
 
J

Joe Kesselman

<script type="text/javascript">
//&lt;![CDATA[
function hiveware_enkoder(){var i,x,y,x=
"x='78<snip><snip>286a293b';y='';for(i=0;i&lt;x.length;i+=2){y+=unescape('%'+x.sub"
+
"str(i,2));}y";
while(x=eval(x));}hiveware_enkoder();
//]]&gt;
</script>

This renders absolutely fine under Internet Explorer but the XSLT
processor in Firefox just hangs when it reaches the code above.

As far as XSLT is concerned, that's just text. Which means that if the
XSLT processor is feeding directly into the rest of the system, rather
than dumping it out as a file and re-parsing it, you're going to get
back exactly that -- text, not a CDATA-section. Which is probably not
going to be interpreted properly.

Since you're escaping individual characters anyway -- what happens if
you simply eliminate the two lines starting with //?

(Caveat: I don't do Javascript, and I *really* don't understand the
passion for CDATA Sections -- they're a bad and limited kluge.)
 
J

Joe Kesselman

"x='78<snip><snip>286a293b';y='';for(i=0;i&lt;x.length;i+=2){y+=unescape('%'+x.sub"

Stupid question from a non-scripter, but... Isn't that inconsistent? If
you're really in a CDATA section, you shouldn't have to escape the < in
the comparson. If you aren't, you *should* have to escape the < and > in
<snip>...?
 
M

Martin Honnen

I have an XSL file that uses hiveware_enkoder javascript to hide an
email address.

This is a snippet from the xsl file:

<script type="text/javascript">
//&lt;![CDATA[
function hiveware_enkoder(){var i,x,y,x=
"x='78<snip><snip>286a293b';y='';for(i=0;i&lt;x.length;i+=2){y+=unescape('%'+x.sub"
+
"str(i,2));}y";
while(x=eval(x));}hiveware_enkoder();
//]]&gt;
</script>

This renders absolutely fine under Internet Explorer but the XSLT
processor in Firefox just hangs when it reaches the code above.

Does that script code use document.write? That does not work in XSLT
generated HTML documents in Firefox, see the FAQ here:
<http://www.mozilla.org/projects/xslt/faq.html>


Does the script work with Firefox when you put it in a static HTML
document and not in the result of an XSLT transformation? If so then the
issue is XSLT related, if not then there is a problem with the script
that is not XSLT related.
 

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

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,175
Latest member
Vinay Kumar_ Nevatia
Top