Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   XML (http://www.velocityreviews.com/forums/f32-xml.html)
-   -   XSL transform not working in Firefox (http://www.velocityreviews.com/forums/t298177-xsl-transform-not-working-in-firefox.html)

zakhan@gmail.com 06-10-2006 04:59 AM

XSL transform not working in Firefox
 
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.le ngth;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.


Joe Kesselman 06-10-2006 05:58 AM

Re: XSL transform not working in Firefox
 
zakhan@gmail.com wrote:
> <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.le ngth;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.)

--
() ASCII Ribbon Campaign | Joe Kesselman
/\ Stamp out HTML e-mail! | System architexture and kinetic poetry

Joe Kesselman 06-10-2006 06:28 AM

Re: XSL transform not working in Firefox
 
>> "x='78<snip><snip>286a293b';y='';for(i=0;i&lt;x.le ngth;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>...?




--
() ASCII Ribbon Campaign | Joe Kesselman
/\ Stamp out HTML e-mail! | System architexture and kinetic poetry

Martin Honnen 06-10-2006 11:42 AM

Re: XSL transform not working in Firefox
 


zakhan@gmail.com wrote:
> 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.le ngth;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.

--

Martin Honnen
http://JavaScript.FAQTs.com/


All times are GMT. The time now is 02:12 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.