Project

Profile

Help

Bug #2495

closed

Named xsl:output inheriting from imported nameless xsl:output

Added by Tomos Hillman over 8 years ago. Updated over 8 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Serialization
Sprint/Milestone:
Start date:
2015-11-12
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

I'm seeing this error when trying to run XSpec on an xslt that has public and system doctype options specified in the xsl:output;

XSpec creates an intermediate spreadsheet with an xsl:output[@name="x:report"] (xmlns:x="http://www.jenitennison.com/xslt/xspec"); this is then used by result-document to create report XML. Looking through Mike's wrox book the rule is that xsl:output declarations are merged where they share the same name

Is this a saxon bug? The behaviour is not replicated in previous versions of Saxon (9.5.1.7).

Actions #1

Updated by Michael Kay over 8 years ago

  • Category set to Serialization
  • Status changed from New to In Progress
  • Assignee set to Michael Kay
  • Priority changed from Low to Normal

What's happening here is a fairly complex interaction between what's happening in the stylesheet and what's happening in the s9api serializer.

The s9api Serializer constructs a Properties object containing the properties set on the Serializer, backed by a default properties object containing the properties defined in the unnamed output declarations of the stylesheet. When you then use a named output declaration in the stylesheet, without specifying a different result destination, it's trying to merge the output properties specified using xsl:result-document with those specified to the Serializer, and the latter have the unnamed output properties mixed in.

This is wrong, but getting it right isn't easy. It's a very messy spec, and a very messy architectural relationship between the XSLT engine and the Serializer.

Actions #2

Updated by Michael Kay over 8 years ago

There are two separate but closely related problems.

Firstly, when xsl:result-document is invoked, it asks the s9api Serializer for a list of properties known to the Serializer. This list includes the properties derived from the unnamed xsl:output declaration in the stylesheet, which I believe is incorrect: it should only include those explicitly declared on the Serializer.

Secondly, in merging the properties (A) defined within the stylesheet (either dynamically on xsl:result-document, or statically on the xsl:output declarations that it references), with the properties (B) declared to the s9api Serializer, Saxon is giving priority to A, whereas the Javadoc for the Serializer says that it should give preference to (B). One can debate which is best, but I intend to make the code match the spec.

Actions #3

Updated by Michael Kay over 8 years ago

  • Status changed from In Progress to Resolved

I have committed a patch on the 9.6 and 9.7 branches to fix these two problems.

Actions #4

Updated by Michael Kay over 8 years ago

  • Found in version changed from 9.6.0.7 to 9.6
Actions #5

Updated by O'Neil Delpratt over 8 years ago

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

Bug fix applied in the Saxon 9.6.0.8 maintenance release

Actions #6

Updated by O'Neil Delpratt over 8 years ago

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

Updated by O'Neil Delpratt over 8 years ago

  • Sprint/Milestone set to 9.6.0.8

Please register to edit this issue

Also available in: Atom PDF