Re: [xsl] error in javascript, that is generated from xsl

Subject: Re: [xsl] error in javascript, that is generated from xsl
From: "Thomas B. Passin" <tpassin@xxxxxxxxxxxx>
Date: Wed, 6 Mar 2002 12:15:39 -0500
You have several error that prevent you from getting correct output.  Here
are the ones I found right away:

1) You use the wrong path to the columns, so your xsl:for-each instruction
returns nothing.  It should read:

        <xsl:for-each select="/some_table/row/column">
            &quot;<xsl:value-of select="."/>&quot;
        </xsl:for-each>

You do not need to escape the quotations marks here, BTW.

2) You have an &quot; entity in the second CDATA section.  Of course, that
is placed literally into the generated javascript, and that gives a
javascript syntax error.  That attempt to create a quotation mark is not
necessary because at that point al the open javascript quotes have been
closed.

3) You do not have commas between the parameters you are generating for the
new Array(), so the javascript would not work even if you fixed the first
two errors.  Check the FAQ sites to see how to create a comma-separated list
that does not end with a comma.

I don't know if there are other other errors.

Cheers,

Tom P

[Shailesh Valvaikar]
>
> I have an xml that has 'row', 'column' kinds elements.
> I want to select all the data in the 'col' elements and show the data in
> html
> tables. But I want to show only a few at a time.
>
> For this, I read the data into a javascript array and then make
> manipulations over that
> array.
> I have specified an xsl stylesheet with the xml file.
> If I see the javascript code the way it would have been generated
> (transformed)
> it works fine in IE 5.5, but when I try generate the same using an xsl, it
> gives an error.
>
> I have included the javascript code in a  CDATA section.
> The errors are at the places where there are '>' and '<' in the script.
This
> should not
> happen when the javascript code is in CDATA section.
> Can anybody point out the problem ?
>
> I have tried the same with Netscape 6. This gives no error and no output!
>



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread