Bug #6117
closedTransformation using memo functions fails if the source is an XdmDocument.asSource()
100%
Description
This is a strange one.
A transformation with an XsltTransformer
fails. A transformation with an Xslt30Transformer
fails if the source is a previously built XdmNode
passed in with document.asSource()
, but passes if the source is, for example, a SAXSource.
Updated by Norm Tovey-Walsh 10 months ago
I've added a unit test which demonstrates the bug: src/test/java/bugs/bug6117
Updated by Michael Kay 10 months ago
Around June 2022, we made changes to introduce the "durability" property of node trees, classifying them as durable or transient. The idea is that in a memo function cache, we avoid having the cache hold strong links to transient nodes; we do this in effect by holding the generateId
of the node as the cache key rather than the node itself (that's a simplification, there are some optimisation tweaks).
The crash occurs because some tree implementations - in this case SpaceStrippedNode
- are returning null for the getDurability()
property.
To fix this I suggest (a) reviewing implementations of TreeInfo
to check that they return a non-null value for the property, and (b) making the call in MemoFunction.substitute()
resilient to getting a null value back,
Updated by Michael Kay 10 months ago
That's working fine on SaxonJ, but C# is fussy about not allowing an enumeration value to be null, so the transpilation is failing. I think I've solved this in the past by adding an extra value such as UNDEFINED to the enumeration.
Updated by Michael Kay 10 months ago
- Subject changed from Transformation fails if the source is an XdmDocument.asSource() to Transformation using memo functions fails if the source is an XdmDocument.asSource()
- Category set to Internals
- Status changed from New to Resolved
- Assignee set to Michael Kay
- Fix Committed on Branch 12, trunk added
- Platforms .NET, Java added
Updated by O'Neil Delpratt 5 months ago
- Status changed from Resolved to Closed
- % Done changed from 0 to 100
- Fixed in Maintenance Release 12.4 added
Bug fix applied in the Saxon 12.4 maintenance release
Please register to edit this issue