J
JavaJug
Hi everybody.
Well. I am using the Swing HTML parser to parse some HTML files and store the
text (among other things) into memory. To do so I use a ParserCallback class
that extends HTMLEdotorkit.ParserCallback, and handle events such as
handleStart/EndTag(), handleText(), handleError()...
It worked very well until I realized that some <STYLE> tag (in the middle of my
page) don't trigger a "handleStartTag()" event, but a "handleError()" event. So
the code between <STYLE> and </STYLE> is computed as text, and as the parser
didn't detect the <style> as a tag, I can't know if the text belongs to such a tag.
Why this parser doesn't trigger a "handleStartTag()" when parsing a <style> tag
? Is anybody aware of that ?
Thank you in advance.
Xav
Well. I am using the Swing HTML parser to parse some HTML files and store the
text (among other things) into memory. To do so I use a ParserCallback class
that extends HTMLEdotorkit.ParserCallback, and handle events such as
handleStart/EndTag(), handleText(), handleError()...
It worked very well until I realized that some <STYLE> tag (in the middle of my
page) don't trigger a "handleStartTag()" event, but a "handleError()" event. So
the code between <STYLE> and </STYLE> is computed as text, and as the parser
didn't detect the <style> as a tag, I can't know if the text belongs to such a tag.
Why this parser doesn't trigger a "handleStartTag()" when parsing a <style> tag
? Is anybody aware of that ?
Thank you in advance.
Xav