Project

Profile

Help

Bug #3064

closed

Incorrect optimization of xsl:attribute using default namespace

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

Status:
Closed
Priority:
Normal
Assignee:
Category:
-
Sprint/Milestone:
-
Start date:
2016-12-09
Due date:
% Done:

100%

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

Description

When all the following conditions apply:

  • an xsl:attribute instruction is used with a computed name,

  • the name can be computed statically

  • the result of computing the name is a string with no namespace prefix

  • the xsl:attribute instruction has no namespace attribute

  • there is a default namespace declaration N in scope for the xsl:attribute instruction

then the attribute MAY be put incorrectly in namespace N rather than in no namespace (this will involve adding a generated prefix such as "ns0".

The problem can probably also occur under analogous conditions in XQuery.

The problem does not always happen when the above conditions are satisfied. Saxon makes two attempts to pre-evaluate the attribute name statically, and the problem only occurs when the first attempt fails (that is, when it is not able to reduce the expression to a simple string) and the second attempt succeeds. It's difficult to be precise about the exact conditions where this will happen but it depends on the expression having a certain level of complexity.

Despite this complex explanation the actual error in the code is very simple: it is doing the local-name-to-QName resolution using a method that treats unprefixed names as being in the default namespace rather than in no namespace.

Actions #1

Updated by Michael Kay over 7 years ago

  • Status changed from New to Resolved
  • Assignee set to Michael Kay
  • Priority changed from Low to Normal
  • Applies to branch 9.7, 9.8 added
  • Fix Committed on Branch 9.7, 9.8 added
Actions #3

Updated by O'Neil Delpratt about 7 years ago

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

Bug fix applied to the Saxon 9.7.0.15 maintenance release

Actions #4

Updated by O'Neil Delpratt almost 7 years ago

  • Fix Committed on Branch trunk added
  • Fix Committed on Branch deleted (9.8)
Actions #5

Updated by O'Neil Delpratt almost 7 years ago

  • Applies to branch deleted (9.8)

Please register to edit this issue

Also available in: Atom PDF