Bug #4220


Exposed visibility of xsl:param

Added by Michael Kay about 5 years ago. Updated over 4 years ago.

Start date:
Due date:
% Done:


Estimated time:
Applies to branch:
Fix Committed on Branch:
Fixed in Maintenance Release:
Found in version:
Fixed in version:


Unit test s9apitests/TestPackage/testPackageRenamingExported is failing with an error saying it cannot accept xsl:param elements with private visibility as hidden.

The spec says (a) that xsl:param elements are always public, and (b) that their visibility cannot be changed by xsl:expose or xsl:accept.

What this test is trying to do is to compile a single package three times with different settings of a static parameter, and then import all three exported packages into a single top-level package (using package aliases to achieve this). It might be that we won't be able to get this to work, but we need to investigate why it's failing the way that it is. The spec says that xsl:param is public, but we're reporting it as private.

Actions #1

Updated by Michael Kay about 5 years ago

There's an inconsistency in the spec here.

§ () says: (a) In the case of an xsl:param element there is no explicit visibility attribute; rather the declaration has the implicit attribute visibility="public". (b) The visibility of a variable declared using an xsl:param element is always public. No xsl:expose element ever matches an xsl:param component.

§9.6 (Static parameters) says: When the static attribute [of xsl:param] is present with the value yes, the visibility attribute must not have a value other than private.

In fact, xsl:param does not allow a visibility attribute.

As far as I can see this hasn't been picked up in any existing bug report on the spec.

Actions #2

Updated by Michael Kay about 5 years ago

Saxon is giving static xsl:param components a visibility of PRIVATE, and non-static xsl:param components a visibility of PUBLIC, which seems a reasonable interpretation of the spec.

I don't think we're doing anything to stop xsl:expose and xsl:accept changing this.

Actions #3

Updated by Michael Kay about 5 years ago

As regards the JUnit tests, if I change pack-120-top.xsl to remove the xsl:accept declarations, I now get "duplicate variable opname" - but if the variable is private in both used packages, this should not happen. In other words, we get different results depending on whether the used packages are exported (saved as SEF files) or not.

Actions #4

Updated by Michael Kay over 4 years ago

Status report: the unit test is still failing (on the development branch, at least)

Actions #5

Updated by Michael Kay over 4 years ago

  • Project changed from Saxon to Non-Conformances
  • Category deleted (XSLT 3.0 packages)

Please register to edit this issue

Also available in: Atom PDF