Project

Profile

Help

Bug #5167

closed

Saxon/.NET 10: DocumentBuilder.DtdValidation option has no effect if JAXP parser is used

Added by Michael Kay over 2 years ago. Updated about 1 year ago.

Status:
Closed
Priority:
Low
Assignee:
Category:
.NET API
Sprint/Milestone:
-
Start date:
2021-11-17
Due date:
% Done:

100%

Estimated time:
Legacy ID:
Applies to branch:
10, 11, trunk
Fix Committed on Branch:
10, 11, trunk
Fixed in Maintenance Release:
Platforms:
.NET

Description

Using the Saxon.Api.DocumentBuilder, the option DocumentBuilder.DtdValidation has no effect if JAXP parser is used - the document is parsed without validation.

Actions #1

Updated by Michael Kay over 2 years 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=false and http://xml.org/sax/features/validation=true so the result is arbitrary.

Actions #2

Updated by Michael Kay over 1 year ago

Note that the problem manifests itself as a failure in NUnit test TestDocumentBuilder.TestSaxSourceValidation().

Actions #3

Updated by Michael Kay over 1 year 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.

Actions #4

Updated by Michael Kay over 1 year ago

  • Category set to .NET API
  • Status changed from In Progress to Resolved
  • Applies to branch 11, trunk added
  • Fix Committed on Branch 10, 11, trunk added
Actions #5

Updated by O'Neil Delpratt over 1 year ago

  • Fixed in Maintenance Release 12.0 added

Bug fix applied in the Saxon 12.0 major release. (Issue remains open awaiting Saxon 10 and 11 maintenance release.)

Actions #6

Updated by O'Neil Delpratt about 1 year ago

  • Fixed in Maintenance Release 11.5 added

Bug fix applied in the Saxon 11.5 maintenance release.

Actions #7

Updated by O'Neil Delpratt about 1 year ago

  • Status changed from Resolved to Closed
  • % Done changed from 0 to 100
  • Fixed in Maintenance Release 10.9 added

Bug fix applied in the Saxon 10.9 maintenance release.

Please register to edit this issue

Also available in: Atom PDF