Validation of xHTML with Dom Parser

H

Heinrich Prokop

Hy

I would like to check the validity of my xHTML Document. Here is the code
for it which i use

private static DOMParser parser = new DOMParser();

static {
// turn on validation
try {
parser.setFeature("http://xml.org/sax/features/validation", true);
parser.setErrorHandler(new ValidityErrorReporter());
}
catch (SAXNotRecognizedException e) {
System.err.println(
"Installed XML parser cannot validate; checking for well-formedness
instead...");
}
catch (SAXNotSupportedException e) {
System.err.println(
"Cannot turn on validation here; checking for well-formedness
instead...");
}

}

The problem is that I get the following error message "Declaration of
'html' not found." Should I include a xHTML scheme? The example is from the
following homepage

http://www.ibiblio.org/xml/slides/sd2000east/dom/59.html

Should be correct but it doesn't work hope you can help me

Thanks
 
S

Sudsy

Heinrich said:
The problem is that I get the following error message "Declaration of
'html' not found." Should I include a xHTML scheme? The example is from the
following homepage

What that's telling you is that it couldn't find the definition for
the html tag. Probable cause: the DTD (DOCTYPE) in your document is
incorrect.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,022
Latest member
MaybelleMa

Latest Threads

Top