<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE faqs SYSTEM 'dtd/faqs.dtd'>
<faqs title='Parser Configuration and Validation'>
 <faq title='Validation and infoset augmentation'>
  <q>What's the result of having a DTD validator or XML Schema validator in the pipeline?</q>
  <a>
   <p>
    If a validator is included in the pipeline, the assessment is
    done, whether the validation feature is set to true or false.
    The validation feature only enables the validation constraint error reporting and it does not control the infoset augmentation: if a validator is included in the pipeline the parser will augment the infoset according to the grammar specified for the instance document. 
   </p>
  </a>
 </faq>

 <faq title='Default Parser Configuration'>
  <q>What validation behavior do I expect from the default parser configuration?</q>
  <a>
   <p>
    The default configuration (StandardParserConfiguration) includes the DTD validator 
    and the Namespace binder. Thus, the <link idref='features' anchor="validation">
    validation feature</link> will enable validation against a DTD only.
To allow validation against XML Schemas you must turn on the <link 
idref='features' anchor="validation">validation feature</link> and the 
<link idref='features' anchor="validation.schema">schema feature</link>, and 
XML Schema Validator will be inserted in the pipeline. 
If you've created your own configuration which does not extend StandardParserConfiguration, 
you must make sure that your configuration inserts all needed validators in the pipeline.
   </p>
  </a>
 </faq>

 <faq title='Validation Features'>
  <q>What happens if I set both validation and schema validation features on?</q>
  <a>
   <p>
     If both validators are present in the pipeline (this is the default behavior), then
   </p>
   <ul>
    <li>if the instance document has only a DTD grammar
        (DOCTYPE before the root element), then only DTD
        validation errors are reported;</li>
    <li>if the instance document has only XML Schema grammars,
        then only XML Schema validation errors are reported</li>
    <li>if the instance document has both DTD and XML Schema
        grammars, validation errors for both DTD and XML
        Schema are reported;</li>
    <li>if no grammar can be found for the instance document,
        the last validator in the pipeline will report validation errors.
    </li>
   </ul>
   <p>
     An application may choose to create a configuration that does not have a DTD 
     validator but has an XML Schema validator. This will turn Xerces into a 
     non-compliant processor according to XML 1.0 and XML Schema specifications, 
     thus the validation/augmentation outcome is undefined.
   </p>

  </a>
</faq>
<faq title='Validation against a specific schema language'>
  <q>How can I tell the parser to validate against XML Schema and not to report DTD validation errors?</q>
  <a>
   <p>
     Currently this is impossible. We hope that JAXP 1.2 will provide this capability 
     via its schema language property. Otherwise, we might introduce a Xerces 
     language property that will allow specifying the language against which validation will occur.
   </p>
   </a>
 </faq>

</faqs>
