XSL transform not working in Firefox

Discussion in 'XML' started by zakhan@gmail.com, Jun 10, 2006.

  1. Guest

    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.
     
    , Jun 10, 2006
    #1
    1. Advertising

  2. 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.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.)

    --
    () ASCII Ribbon Campaign | Joe Kesselman
    /\ Stamp out HTML e-mail! | System architexture and kinetic poetry
     
    Joe Kesselman, Jun 10, 2006
    #2
    1. Advertising

  3. >> "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>...?




    --
    () ASCII Ribbon Campaign | Joe Kesselman
    /\ Stamp out HTML e-mail! | System architexture and kinetic poetry
     
    Joe Kesselman, Jun 10, 2006
    #3
  4. 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.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.

    --

    Martin Honnen
    http://JavaScript.FAQTs.com/
     
    Martin Honnen, Jun 10, 2006
    #4
    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. KathyB
    Replies:
    0
    Views:
    1,044
    KathyB
    Jun 25, 2003
  2. Anthony Harkness-Gripe

    Dataset to XSL Transform not displaying HTML--only XML

    Anthony Harkness-Gripe, Aug 14, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    1,041
    itnrant
    Jul 8, 2008
  3. Angus Parvis
    Replies:
    0
    Views:
    634
    Angus Parvis
    Aug 26, 2004
  4. Replies:
    1
    Views:
    3,657
    A. Bolmarcich
    May 27, 2005
  5. N. Demos
    Replies:
    2
    Views:
    367
    N. Demos
    May 13, 2005
Loading...

Share This Page