Saxon/.NET 10: DocumentBuilder.DtdValidation option has no effect if JAXP parser is used
Using the Saxon.Api.DocumentBuilder, the option
DocumentBuilder.DtdValidation has no effect if JAXP parser is used - the document is parsed without validation.
Updated by Michael Kay 11 months ago
The problem is actually in the Java code of
ParseOptions.merge(). This code attempts to combine two sets of parser options (for example those set in the configuration file and those set on the document builder) by taking non-default values in preference to default values. However, for the ParserFeatures field, we're simply taking the union of the two sets of ParserFeatures, which in this case includes both
http://xml.org/sax/features/validation=true so the result is arbitrary.
Updated by Michael Kay 9 days ago
Confirmed that if we merge features in such a way that a "true" setting always overrides a "false" setting, the unit test now passes.
The code change applies to the 10.x, 11.x, and 12.x branches even though we have only seen adverse effects on the 10.x branch.
Please register to edit this issue