Topic: using javascript in a xsl stylesheet |
|
---|---|
Author | Thread |
Obsessive-Compulsive (I) Inmate From: Bologna, Italy |
posted 02-05-2003 16:57
maybe i'm asking something idiot.. please forgive me! |
Lunatic (VI) Mad Scientist From: Massachusetts, USA |
posted 02-05-2003 18:04
In XSLT, anything within comment tags (<!--, --> ) is ignored. Your script is within comment tags. Those must be removed. If you want the transformed document to have comment tags, you must use <xsl:comment>...</xsl:comment>. |
Maniac (V) Mad Scientist From: 100101010011 <-- right about here |
posted 02-05-2003 18:28
umm ?? |
Obsessive-Compulsive (I) Inmate From: Bologna, Italy |
posted 02-05-2003 23:51
Well i have to explain... in the former example i was using the tag <script> in the head section of the html code generated by the xsl stylesheet. If i erase the comment tags i have to use the entity names & and < --- and the functions don't work. |
Lunatic (VI) Mad Scientist From: Massachusetts, USA |
posted 02-05-2003 23:59
Did you actually try the character entities? They're required, and will be parsed into what you intend the code to be. (That is, if you say "if (blah &amp;&amp; blah)", the parser will insert the text "if (blah && blah)" into the HTML document. |
Obsessive-Compulsive (I) Inmate From: Bologna, Italy |
posted 02-07-2003 17:33
I used the character entities. |
Lunatic (VI) Mad Scientist From: Massachusetts, USA |
posted 02-07-2003 17:38
Double-click the text "error while loading the page," and a more detailed error message should appear. It will also give you the line number in the HTML code that the error appears. You can look into the HTML code with right click -> view source to see what's on that line, and then see if you can figure out what went wrong. |
Paranoid (IV) Inmate From: Den Haag, Netherlands |
posted 02-08-2003 10:20
I always use Netscape to test my code once it seems to be ready .. that way I can use the Javascript Console to see where the error really is. Explorer's error messages (even the detail ones) are abysmally bad, and the line refs have no relevance, since they only seem to point to the HTML line where the error started from ... At least NS tells you the scipt file and the line number .. it even lists the line generating the error. |