DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=16952>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=16952

HTMLParser can't skip to parse some javascript code

           Summary: HTMLParser can't skip to parse some javascript code
           Product: Lucene
           Version: 1.2
          Platform: PC
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Examples
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


I found that org/apache/lucene/demo/html/HTMLParser.jj have a bug. I tried to 
parse the following HTML content:

        <script language="JavaScript">
        function preset() {
        var art_id=GetParamValue("art_id");
        //      alert("bbbb"+art_id);
        if(isNaN(art_id) || art_id=="") {
            document.dymenu.article_id.selectedIndex=2;
        //      alert("aaaa");
            return;
        }
        for(var i=1;i<document.dymenu.article_id.options.length;i++) {
            if(document.dymenu.article_id.options[i].value==art_id) // line 625
            break;
            }
        document.dymenu.article_id.selectedIndex=i;
        return;
        }
        preset();
        </script></td></tr><tr><td align=right>
++++++++++++++++++++++++++++
it threw an exception:

adding ../projecthand/applenews2.html
Parse Aborted: Lexical error at line 625, column 60.  Encountered: "=" (61), 
after : ""

++++++++++++++++++++++++++++++

After i added comment tags "<!--" and "//-->" inside "<script>...</script>" 
tags. it worked again. i think the HTMLParser should skip the javascript code 
without comment tags. Also i tried another javascript code block in the same 
file just before the above javascript code block and HTMLParser able to skip 
but still fail to parse the above javascript code block ....

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to