You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by "Williamson, Siehnai" <sw...@docucorp.com> on 2002/02/26 22:05:08 UTC

Omitting validation error message

Hi,

Right now in Xerces 1.6, an error message "Unknown element 'elementname'",
appears when you attempt to validate a document that has no DTD/Schema
declaration.  Although the document is well-formed etc., once the validation
switch is turned on before parsing, an error will occur.  This never
happened in Xerces 1.5.  Is there a way to omit validation errors if the
document is OK but the validation switch was turned on before parse?  Or is
there a better way to have Xerces automatically determine whether there is a
DTD declaration needing validation or no DTD declaration, henceforth, no
validation.

Thanks,
Siehnai 

Re: Omitting validation error message

Posted by Tinny Ng <tn...@ca.ibm.com>.
Omitting validation error message> Or is there a better way to have Xerces automatically determine whether there is a DTD declaration needing validation or no DTD declaration, henceforth, no validation.

Use setValidationScheme(SAXParser::Val_Auto)

Tinny
  ----- Original Message ----- 
  From: Williamson, Siehnai 
  To: xerces-c-dev@xml.apache.org 
  Sent: Tuesday, February 26, 2002 4:05 PM
  Subject: Omitting validation error message


  Hi, 

  Right now in Xerces 1.6, an error message "Unknown element 'elementname'", appears when you attempt to validate a document that has no DTD/Schema declaration.  Although the document is well-formed etc., once the validation switch is turned on before parsing, an error will occur.  This never happened in Xerces 1.5.  Is there a way to omit validation errors if the document is OK but the validation switch was turned on before parse?  Or is there a better way to have Xerces automatically determine whether there is a DTD declaration needing validation or no DTD declaration, henceforth, no validation.

  Thanks, 
  Siehnai 


Re: Omitting validation error message

Posted by Tinny Ng <tn...@ca.ibm.com>.
Omitting validation error message> Or is there a better way to have Xerces automatically determine whether there is a DTD declaration needing validation or no DTD declaration, henceforth, no validation.

Use SAXParser::setValidationScheme(SAXParser::Val_Auto);
(similarly for DOMParser, IDOMParser ... etc.)

Tinny
  ----- Original Message ----- 
  From: Williamson, Siehnai 
  To: xerces-c-dev@xml.apache.org 
  Sent: Tuesday, February 26, 2002 4:05 PM
  Subject: Omitting validation error message


  Hi, 

  Right now in Xerces 1.6, an error message "Unknown element 'elementname'", appears when you attempt to validate a document that has no DTD/Schema declaration.  Although the document is well-formed etc., once the validation switch is turned on before parsing, an error will occur.  This never happened in Xerces 1.5.  Is there a way to omit validation errors if the document is OK but the validation switch was turned on before parse?  Or is there a better way to have Xerces automatically determine whether there is a DTD declaration needing validation or no DTD declaration, henceforth, no validation.

  Thanks, 
  Siehnai