Validation of xHTML with Dom Parser

Discussion in 'Java' started by Heinrich Prokop, Nov 13, 2003.

  1. 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
     
    Heinrich Prokop, Nov 13, 2003
    #1
    1. Advertising

  2. Heinrich Prokop

    Sudsy Guest

    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.
     
    Sudsy, Nov 13, 2003
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    7
    Views:
    909
  2. chronos3d
    Replies:
    9
    Views:
    804
    Andy Dingley
    Dec 5, 2006
  3. Usha2009
    Replies:
    0
    Views:
    1,147
    Usha2009
    Dec 20, 2009
  4. xhtml champs
    Replies:
    0
    Views:
    544
    xhtml champs
    Aug 1, 2011
  5. xhtml champs
    Replies:
    0
    Views:
    1,059
    xhtml champs
    Aug 2, 2011
Loading...

Share This Page