R
Ronald Fischer
I would like to check a HTML file for errors such as mismatched start/end
tags or typos in the tags. Hence I need a validating HTML parser, which
gives me error messages when it encounters an error. I thought that
javax.swing.text.html.parser.DocumentParser could be a good choice.
I have now the problem that I don't know how to specify the DTD:
dp=new DocumentParser(DTD.getDTD(???WHAT SHOULD I WRITE HERE???));
I tried to call getDTD with the following arguments:
"http://www.w3.org/TR/html4/strict.dtd"
"-//W3C//DTD HTML 4.0 Transitional//EN"
In neither case was the parser able to recognize any tag. It called
the handleError callback on any tag encountered.
Unfortunately, the documentation for the class DTD is next to
non-existent. Could someone please help me with this?
Ronald
tags or typos in the tags. Hence I need a validating HTML parser, which
gives me error messages when it encounters an error. I thought that
javax.swing.text.html.parser.DocumentParser could be a good choice.
I have now the problem that I don't know how to specify the DTD:
dp=new DocumentParser(DTD.getDTD(???WHAT SHOULD I WRITE HERE???));
I tried to call getDTD with the following arguments:
"http://www.w3.org/TR/html4/strict.dtd"
"-//W3C//DTD HTML 4.0 Transitional//EN"
In neither case was the parser able to recognize any tag. It called
the handleError callback on any tag encountered.
Unfortunately, the documentation for the class DTD is next to
non-existent. Could someone please help me with this?
Ronald