InterviewSolution
| 1. |
Why Does The Parser Still Try To Locate The Dtd Even Validation Is Turned Off And How To Ignore External Dtd Reference? |
|
Answer» When DTD is referenced, the PARSER will TRY to read it, because DTDs can provide a lot more information than just validation. It defines entities and notations, external unparsed entities, default attributes, CHARACTER entities, etc. Therefore the parser will always try to read it if present, even if validation is turned off. To ignore external DTDs completely you can callsetLoadExternalDTD(false) (orsetFeature(XMLUni::fgXercesLoadExternalDTD, false)to disable the loading of external DTD. The parser will then ignore any external DTD completely if the validationScheme is set to Val_Never. Note: This FLAG is IGNORED if the validationScheme is set to Val_Always or Val_Auto. When DTD is referenced, the parser will try to read it, because DTDs can provide a lot more information than just validation. It defines entities and notations, external unparsed entities, default attributes, character entities, etc. Therefore the parser will always try to read it if present, even if validation is turned off. To ignore external DTDs completely you can callsetLoadExternalDTD(false) (orsetFeature(XMLUni::fgXercesLoadExternalDTD, false)to disable the loading of external DTD. The parser will then ignore any external DTD completely if the validationScheme is set to Val_Never. Note: This flag is ignored if the validationScheme is set to Val_Always or Val_Auto. |
|