Actions
Bug #3691
closedBad parent pointer error message
Start date:
2018-02-20
Due date:
% Done:
100%
Estimated time:
Legacy ID:
Applies to branch:
9.8, trunk
Fix Committed on Branch:
9.8, trunk
Fixed in Maintenance Release:
Platforms:
Description
I just upgraded from 9.4.0.6 to 9.8.0.8 and I'm getting an error now that didn't occur before.
Here is the error message:
- Bad parent pointer found in expression root / data / vineland2COM at file:/C:/saxonIssue/vineland2.xsl#17 *
The output seems OK, which makes sense as explained in posts like:
https://saxonica.plan.io/boards/3/topics/6838?r=6841#message-6841 and
https://saxonica.plan.io/issues/2555
I have appended a test case below that causes the error.
xsl:
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
version="2.0">
<xsl:variable name="medianAllDomains">
<xsl:call-template name="calcMedian">
<xsl:with-param name="values" select="(/data/test/vineland2/vineland2COM,
/data/test/vineland2/vineland2DLS,
/data/test/vineland2/vineland2SOC,
/data/test/vineland2/vineland2MOT)"/>
</xsl:call-template>
</xsl:variable>
<xsl:template name="calcMedian">
<xsl:param name="values" as="xs:double*" required="yes"/>
<xsl:variable name="sortedValues" as="item()*">
<xsl:perform-sort select="$values">
<xsl:sort/>
</xsl:perform-sort>
</xsl:variable>
<xsl:variable name="count" select="count($sortedValues)"/>
<xsl:choose>
<xsl:when test="($count mod 2) = 0">
<xsl:variable name="midPos" select="$count div 2"/>
<xsl:value-of select="
avg(($sortedValues[$midPos], $sortedValues[$midPos + 1]))"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$sortedValues[($count+1) div 2]"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>
java:
SAXSource saxSource = new SAXSource();
saxSource.setInputSource(new InputSource(
"file:/c:/saxonIssue/vineland2.xsl"));
try {
XsltCompiler compiler = new Processor(false).newXsltCompiler();
compiler.compile(saxSource);
} catch (SaxonApiException e) {
Logger.getAnonymousLogger().log(Level.SEVERE, "an error occurred while processing xslt: " + e.getMessage(), e);
}
Related issues
Please register to edit this issue
Actions