Bug #2302


Node identity: collection() ↔ doc()

Added by Christian Grün about 9 years ago. Updated about 8 years ago.

XSLT conformance
Start date:
Due date:
% Done:


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


Hi Michael,

I believe the following query should yield true when applied on a directory 'dir' with a single XML file 'doc.xml'. Instead, it yields 'false':

collection('dir') is doc('dir/doc.xml')
Actions #1

Updated by Michael Kay about 9 years ago

  • Category set to XSLT conformance
  • Status changed from New to Resolved
  • Priority changed from Low to Normal

Yes, the stability of collections is a known conformance issue. When the standard (default) CollectionURIResolver is used, collections are not stable. In several respects: repeated calls on collection() with the same URI may return different sets of documents, the contents of individual documents may change, and the identity of documents is not necessarily the same as the identify of a document retrieved directly using the doc() function.

These issues will be addressed in Saxon 9.7, which will give the user control over whether to incur the costs associated with stability of collections.

Actions #2

Updated by Michael Kay about 9 years ago

For reference, here's how it will work in 9.7:

Collections can now be stable, meaning that multiple calls with the same collection URI are guaranteed to

    return the same results. For conformance with the specifications, this is the default, although it can be

    expensive, because the contents of a collection have to be maintained in memory just in case it is used

    again. Collection stability can be switched off in several ways: the collection URI can include the query

    parameter <code>stable=no</code>; the collection URI resolver can return the property value <code>stable="false"</code>

    in the <code>Properties</code> object supplied to the <code>resolve()</code> method; or the Configuration

    property <code>FeatureKeys.STABLE_COLLECTION_URI</code> can be set to false.</p>
Actions #3

Updated by Christian Grün about 9 years ago

Thanks for the summary; sounds like a sound solution.

Actions #4

Updated by O'Neil Delpratt almost 9 years ago

  • Status changed from Resolved to Closed
  • % Done changed from 0 to 100
  • Found in version changed from EE to 9.6
  • Fixed in version set to

Bug fix applied in the Saxon maintenance release.

Actions #5

Updated by O'Neil Delpratt about 8 years ago

  • Sprint/Milestone set to
  • Applies to branch 9.6 added
  • Fix Committed on Branch 9.6 added
  • Fixed in Maintenance Release added

Please register to edit this issue

Also available in: Atom PDF