Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Validation of xHTML with Dom Parser

Reply
Thread Tools

Validation of xHTML with Dom Parser

 
 
Heinrich Prokop
Guest
Posts: n/a
 
      11-13-2003
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/sd...st/dom/59.html

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

Thanks


 
Reply With Quote
 
 
 
 
Sudsy
Guest
Posts: n/a
 
      11-13-2003
Heinrich Prokop wrote:

> Hy

<snip>
> 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.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
PSD to XHTML Conversion, PSD to HTML, Joomla, Drupal, WordpressConversion, PSD to XHTML CSS xhtml champs XML 0 08-02-2011 05:40 AM
PSD to XHTML Conversion, PSD to HTML, Joomla, Drupal, WordpressConversion, PSD to XHTML CSS xhtml champs C Programming 0 08-01-2011 06:29 AM
convert xhtml to another xhtml using xslt Usha2009 XML 0 12-20-2009 01:13 PM
Should I Convert Site To XHTML or XHTML mobile? chronos3d HTML 9 12-05-2006 04:46 PM
parse URL (href) from xhtml, xhtml -> text, for data hawat.thufir@gmail.com XML 7 02-08-2006 07:39 PM



Advertisments