Bug #3995

Undocumented and untested extensions to xsl:source-document

Added by Michael Kay almost 3 years ago. Updated 6 months ago.

Saxon extensions
Start date:
Due date:
% Done:


Estimated time:
Legacy ID:
Applies to branch:
10, 9.9
Fix Committed on Branch:
Fixed in Maintenance Release:


The 9.9 implementation of xsl;source document includes code to implement a number of extension attributes which appear (as far as I can tell) to be undocumented and untested. These include:

saxon:dtd-validation=yes|no - controls whether DTD validation takes place

saxon:expand-attribute-defaults=yes|no - controls whether attribute defaults defined in the schema or DTD are expanded

saxon:line-numbering=yes|no - controls whether line numbers are maintained for the document

saxon:xinclude - controls whether XInclude processing takes place

saxon:strip-space - controls the whitespace stripping that is applied

These extensions should either be properly documented and tested, or removed.


#1 Updated by Michael Kay almost 3 years ago

  • Subject changed from Undocumented and untested extensions to xsl;source-document to Undocumented and untested extensions to xsl:source-document

#2 Updated by Michael Kay almost 3 years ago

saxon:line-numbering now working and tested in xslt30extra/source-document

#3 Updated by Michael Kay almost 3 years ago

saxon:strip-space now working and tested. Allowed values #all, #none, #ignorable, #default.

#4 Updated by Debbie Lockett over 2 years ago

9.9.1 release included the code fixes to allow saxon:line-numbering and saxon:strip-space attributes. The documentation has (belatedly) now been updated, see xsl-elements/source-document and extensions/attributes.

Committed on 9.9 and 10.0 dev branches. 9.9 documentation updated online (XML and HTML versions).

#5 Updated by Michael Kay about 2 years ago

  • Category set to Saxon extensions
  • Status changed from New to In Progress
  • Priority changed from Low to Normal

Contrary to the documentation, these extensions are currently working in Saxon-HE. In accordance with the general policy that Saxon extensions require PE or EE, this will be changed.

#6 Updated by Michael Kay over 1 year ago

  • Status changed from In Progress to Resolved
  • Applies to branch 10 added
  • Fix Committed on Branch 10 added

On the 10.0 branch I have made the change to check for a PE license when extension attributes are used.

Although this is consistent with the documentation, I will avoid adding the extra checks on the 9.9 branch in the interests of application stability.

#7 Updated by Michael Kay over 1 year ago

  • Status changed from Resolved to In Progress

I don't think it is conformant to raise an error if these attributes are used on Saxon-HE

The spec (ยง3.2) says: "An implementation that does not recognize the name of an extension attribute, or that does not recognize its value, must perform the transformation as if the extension attribute were not present. As always, it is permissible to produce warning messages."

So I think we should produce a warning and ignore the attribute.

#8 Updated by Michael Kay over 1 year ago

Revisiting this, and extending the scope to include options for saxon:doc(), saxon:parse(), and saxon:parse-html().

Currently xsl:source-document supports:

  • validation
  • type
  • use-accumulators
  • saxon:dtd-validation - boolean
  • saxon:expand-attribute-defaults - boolean
  • saxon:line-numbering - boolean
  • saxon:xinclude - boolean
  • saxon:strip-space - #all, #none, #ignorable, #default

saxon:doc supports:

  • validation
  • type
  • dtd-validation
  • strip-space - all, none, package-defined
  • stable - boolean, not documented, accepted but not implemented
  • accumulators - xs:QName*, implemented but not documented
  • use-xsi-schema-location - boolean, implemented but not documented

saxon:parse() and saxon:parse-html() do not have an options parameter, but I would like to give them one, especially to allow a base URI to be specified.

Other candidates for controlling parsing and document building (available in the Java ParseOptions interface) include:

  • validationParams (for validating against a parameterized schema)
  • topLevelElement
  • topLevelType
  • parser class
  • tree model
  • error handling options

#9 Updated by Debbie Lockett 7 months ago

  • Assignee changed from Michael Kay to Debbie Lockett

#10 Updated by Debbie Lockett 7 months ago

  • Assignee changed from Debbie Lockett to Michael Kay

Documentation updated to match what is currently implemented, i.e. :

  1. Added documentation for the xsl:source-document attributes saxon:dtd-validation, saxon:expand-attribute-defaults, and saxon:xinclude (at /xsl-elements/source-document, and under /extensions/attributes)
  2. Added documentation for the use-xsi-schema-location option for saxon:doc().

Committed on the Saxon 10 and trunk branches. (The online documentation will be updated with the next maintenance release.)

I have not added the saxon:doc options stable and base-uri, as it seems that these are accepted but not actually implemented.

Note that it was suggested in #note-8 that the options parameter might be added to saxon:parse and saxon:parse-html, but so far it has not been. (Perhaps we could open a new feature bug to pursue this, and close this bug.)

#11 Updated by Michael Kay 6 months ago

  • Status changed from In Progress to Resolved

I think it's time to close this as resolved, we have done enough for the time being.

#12 Updated by O'Neil Delpratt 6 months ago

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

Bug fix applied to Saxon 10.5 maintenance release.

Please register to edit this issue

Also available in: Atom PDF