Bug #5803
closedXPathExampleSA schema-aware sample application is failing
100%
Description
This sample application is failing on the 12.x branch, but the erroneous code is also present in 11.x and earlier releases.
The sample uses the JAXP XPath API, but with schema-aware processing.
The extension function ToCentimetres
is expecting the first argument to be supplied as a list of BigDecimal values - presumably based on the validated type of the DIMENSIONS element. It is actually being supplied as a single BigDecimal value.
Updated by Michael Kay almost 2 years ago
During type-checking, Atomizer.computeSingleValued()
has wrongly concluded that the result of data(DIMENSIONS)
will be a singleton, and is therefore passing a single number to the XPath JAXP extension function, which crashes because it expects a list.
Saxon 11 is making the same incorrect inference (the code is unchanged), but isn't making use of the information at run-time. The new expression elaboration code does make use of the information. Specifically, in 11.x, Atomizer.oneToOne is computed as false, but Atomizer.getAtomizingIterator() ignores this and processes the value as a sequence regardless. In 12.x, AtomizerElaborator.lazily()
constructs return new LearningEvaluator(expr, new MemoClosureEvaluator(expr, elaborateForPull()));
, and the MemoClosureEvaluator
calls Cardinality.allowsMany()
on the Atomizer, which thinks it will return a singleton.
Updated by Michael Kay almost 2 years ago
The incorrect logic is in Atomizer.computeSingleValued() where it does:
if ( .... || st.isComplexType() && st != AnyType.getInstance())) {
singleValued = true;
}
In this case st is a complex type with simple content, and the simple content type is a list type, so the atomised result is sequence-valued.
Updated by Michael Kay almost 2 years ago
- Project changed from 20 to Saxon
- Description updated (diff)
- Category set to Internals
- Status changed from New to In Progress
- Priority changed from Low to Normal
- Applies to branch 10, 11, trunk added
- Fix Committed on Branch trunk added
Updated by Michael Kay almost 2 years ago
- Status changed from In Progress to Resolved
- Fix Committed on Branch 10, 11 added
- Platforms .NET, Java added
Updated by Community Admin almost 2 years ago
- % Done changed from 0 to 100
- Fixed in Maintenance Release 12.0 added
Bug issue fix applied in the Saxon 12.0 Major Release. Leaving this bug marked as Resolved until fix applied
Updated by O'Neil Delpratt almost 2 years ago
- Fixed in Maintenance Release 11.5 added
Bug fix applied in the Saxon 11.5 maintenance release.
Updated by O'Neil Delpratt almost 2 years ago
- Status changed from Resolved to Closed
- Fixed in Maintenance Release 10.9 added
Bug fix applied in the Saxon 10.9 maintenance release.
Please register to edit this issue