[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: error in javascript, that is generated from xsl

Subject: Re: error in javascript, that is generated from xsl
From: "Thomas B. Passin" <tpassin@xxxxxxxxxxxx>
Date: Wed, 6 Mar 2002 12:15:39 -0500
javascript xsl error entity
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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.