Project

Profile

Help

Support #4398

resolve-QName thinks prefix is not declared when it is not in use on literal result element

Added by Priscilla Walmsley 4 months ago. Updated 4 months ago.

Status:
Closed
Priority:
Low
Assignee:
-
Category:
-
Sprint/Milestone:
-
Start date:
2019-11-27
Due date:
% Done:

0%

Legacy ID:
Applies to branch:
9.8
Fix Committed on Branch:
Fixed in Maintenance Release:

Description

The attached XSLT results in an error that the prefix 'ord' has not been declared, but it has (both in the XSLT and in the literal result element). It seems that the issue is that the 'ord' prefix is declared but not actually used by the element. When I use ord:root instead, it works. Shouldn't resolve-QName be based on what namespaces are declared, vs. which ones are actually used by the element referenced in the second argument?

Engine name: Saxon-PE 9.8.0.12 Description: Namespace prefix 'ord' has not been declared

saxonissues2.xsl (447 Bytes) Priscilla Walmsley, 2019-11-27 18:16 saxonissues2.xsl
dummyin.xml (66 Bytes) Priscilla Walmsley, 2019-11-27 18:16 dummyin.xml

History

#1 Updated by Michael Kay 4 months ago

I think this one is a user error. You need to remove the attribute

exclude-result-prefixes="#all"

from the stylesheet. The attribute causes the "ord" namespace declaration to be omitted from the constructed <root> element

#2 Updated by Michael Kay 4 months ago

  • Tracker changed from Bug to Support
  • Status changed from New to Closed

Closing as user error (please re-open if you think I'm wrong)

#3 Updated by Priscilla Walmsley 4 months ago

Thanks, you're right of course. For some reason I always thought of exclude-result-prefixes stripping the namespace declarations in the actual (final) results, not affecting the values of variables, but I see now the spec is clear on this point.

Please register to edit this issue

Also available in: Atom PDF