Validating xml with xsd schema using xerces

Discussion in 'XML' started by Yona, Oct 29, 2003.

  1. Yona

    Yona Guest

    Im trying to validate an xml file using the xercesDomParser,
    but it seems like it doesnt validate the xml file.
    I get an error only if the schema isnt valid.

    the code is:
    DOMTreeErrorReporter *errReporter = new DOMTreeErrorReporter();
    parser->setErrorHandler(errReporter);

    parser->setDoSchema(TRUE);
    parser->setDoNamespaces(TRUE);
    parser->setDoValidation(TRUE);
    parser->setExternalSchemaLocation("urn:books c:\books.xsd");

    parser->setValidationScheme(AbstractDOMParser::Val_Always);
    parser->setValidationSchemaFullChecking(TRUE);
    try{
    parser->parse(pFileName);
    }
    catch{..}...


    why doesnt it throw an error when an element has a wrong value or no closing tag??

    thanx,
    huku
     
    Yona, Oct 29, 2003
    #1
    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. Jasmin Wason
    Replies:
    0
    Views:
    493
    Jasmin Wason
    Aug 1, 2003
  2. Duncan Smith
    Replies:
    1
    Views:
    469
    Jesper Zedlitz
    Dec 15, 2003
  3. Replies:
    0
    Views:
    562
  4. -saarland.de
    Replies:
    8
    Views:
    1,770
    naivexml
    May 16, 2011
  5. Replies:
    5
    Views:
    1,030
    Brian McCauley
    Nov 29, 2006
Loading...

Share This Page