Topic: using javascript in a xsl stylesheet (Page 1 of 1) |
|
---|---|
Obsessive-Compulsive (I) Inmate From: Bologna, Italy |
![]() maybe i'm asking something idiot.. please forgive me! |
Lunatic (VI) Mad Scientist From: Massachusetts, USA |
![]() 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 |
![]() umm ?? |
Obsessive-Compulsive (I) Inmate From: Bologna, Italy |
![]() 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 |
![]() 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 |
![]() I used the character entities. |
Lunatic (VI) Mad Scientist From: Massachusetts, USA |
![]() 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 |
![]() 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. |