Project

Profile

Help

Bug #2403

closed

IDREF validation failures not detected by xsl:copy-of

Added by Michael Kay over 9 years ago. Updated almost 9 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Schema-Aware processing
Sprint/Milestone:
Start date:
2015-06-18
Due date:
% Done:

100%

Estimated time:
Legacy ID:
Applies to branch:
9.6
Fix Committed on Branch:
9.6
Fixed in Maintenance Release:
Platforms:

Description

When a document node is copied, and validated, using

<xsl:copy-of select="/" validation="strict"/>

then violations of IDREF constraints (that is, IDREF values with no corresponding ID value) are not detected.

Bug found using new XSLT test case copy-5021

Actions #1

Updated by Michael Kay over 9 years ago

  • Status changed from New to Resolved

Patch applied to fix the problem on the 9.6 and 9.7 branches. The solution needed to be applied separately to the compiled and interpreted cases. The problem arose because the Receiver doing document-level validation was not closed after use, and unresolved IDREF values are detected during the close() operation.

Actions #2

Updated by Michael Kay over 9 years ago

  • Status changed from Resolved to In Progress

The patch was found to have adverse effects on the DITA-OT stylesheets: see bug 2405.

Actions #3

Updated by Michael Kay over 9 years ago

The patch (which calls Receiver.close() at the end of the copy() operation) also causes tests namespace-3501, -2, and -3 to fail. Basically it's wrong for xsl:copy to close the destination, because it can be part of a sequence constructor (etc) that still wants to output more content to this destination. But calling close() is at the moment the only way we can trigger IDREF validation. We should consider moving the IDREF checking into endDocument().

For the moment I have removed the patch from CopyOf and CopyOfCompiler.

Actions #4

Updated by Michael Kay over 9 years ago

  • Status changed from In Progress to Resolved

I have now moved the checking of unresolved IDREFs from the close() method to the endDocument() method in IdValidator.java. This appears to do the trick with no adverse side effects. Patch applied on the 9.6 and 9.7 branches.

Actions #5

Updated by O'Neil Delpratt over 9 years ago

  • Status changed from Resolved to Closed
  • % Done changed from 0 to 100
  • Fixed in version set to 9.6.0.7

Bug fix applied in the Saxon 9.6.0.7 maintenance release.

Actions #6

Updated by O'Neil Delpratt almost 9 years ago

  • Applies to branch 9.6 added
  • Fix Committed on Branch 9.6 added
  • Fixed in Maintenance Release 9.6.0.7 added
Actions #7

Updated by O'Neil Delpratt almost 9 years ago

  • Sprint/Milestone set to 9.6.0.7

Please register to edit this issue

Also available in: Atom PDF