I'd have to see your page to help with the first problem. The second problem, I think you may have explained incorrectly. It is perhaps more likely that the </script> tag comes after a closing </div>. However, the way you explained it may be the way the xml parser sees it. In any event, what you can try is to locate any closing tags inside the script (usually found in variable assignments, 'innerHTML=' statements, and 'document.write' or 'document.writeLn' statements and escape their /'s with \'s, example:
<\/div>
If there is an actual </script> tag inside the script as part of a variable, innerHTML, or write statement, it needs special handling but, should already have it as, that would be a problem in normal HTML as well (all except for the escaping \, highlighted red). It should be treated like so or similar (there are other workable ways):
Code:
document.write('<'+'\/'+'s'+'cript>')
Also, it is a good idea to make all javascripts external for XHTML/xml.
Bookmarks