Bug #2403
closed
IDREF validation failures not detected by xsl:copy-of
Category:
Schema-Aware processing
Fix Committed on Branch:
9.6
Fixed in Maintenance Release:
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
- 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.
- Status changed from Resolved to In Progress
The patch was found to have adverse effects on the DITA-OT stylesheets: see bug 2405.
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.
- 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.
- 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.
- Applies to branch 9.6 added
- Fix Committed on Branch 9.6 added
- Fixed in Maintenance Release 9.6.0.7 added
- Sprint/Milestone set to 9.6.0.7
Please register to edit this issue
Also available in: Atom
PDF