[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
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"> "<xsl:value-of select="."/>" </xsl:for-each> You do not need to escape the quotations marks here, BTW. 2) You have an " 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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|