Grasping at Straws: Consistent but Mystifying Failure for Saxon 9.5

Eliot Kimber <ekimber-xb9TSTQ6enFWk0Htik3J/[email protected]>
Newsgroups gmane.text.xml.saxon.help
Message-ID <[email protected]>
In the context of the RSuiteCMS application, we have custom code that uses Saxon EE 9.5.1.10 to run a transform.

The same transform-running class is used from two different other class--one always works and one consistently fails on some, but not all, input. The transform itself has been in constant successful use for a couple of years.

It is not in my power to upgrade the Saxon version.

I tried debugging using the HE source but the running EE code diverges from HE so that's not really practical.

I'm assuming that it must be something about the local Java environment when the failing code calls transform--I can't think of anything in the source data or style sheet that would cause the failure below, so it must be some non-obvious difference in the calling code that is tripping over this failure.

My question: given the exception trace below, is there any idea what the cause of this error might be or does the fact that it happens in once code path context but not another for the same inputs provide clue?

The line reported in the trace, dita2htmlImpl.xsl:202, is :

<xsl:sequence select="$out">

Where $out is:

    <xsl:variable name="out" as="element()">
      <xsl:apply-templates select="$base-result" mode="change-tc-markup-in-merge-regions"/>
    </xsl:variable>

Line 202 is the last executed line in the transform and since $out is a variable it means that all the processing actually happens when $out is sent to the result.

It looks like the failure is in the output serializer:

Line 296 of LinkedTreeBuilder is:

TextImpl n = nodeFactory.makeTextNode(currentNode, chars);

I can debug through the source code but I can't right now devote the time needed to make the Saxon code into a working Eclipse project so I can set a conditional breakpoint on it, so I was hoping the error itself would point in the direction of what's wrong in our calling code...

Thanks,

Eliot

Here is the trace:

2020-07-23 13:50:01.451 rsuite-server ERROR [http-bio-8080-exec-971] <RestAPIv1.req-10623> gov.gao.newblue.rsuite.domain.links.LinkFactory - null
java.lang.NullPointerException
                at net.sf.saxon.tree.linked.LinkedTreeBuilder.characters(LinkedTreeBuilder.java:296)
                at net.sf.saxon.event.ProxyReceiver.characters(ProxyReceiver.java:193)
                at net.sf.saxon.event.ComplexContentOutputter.characters(ComplexContentOutputter.java:168)
                at net.sf.saxon.event.SequenceWriter.characters(SequenceWriter.java:272)
                at net.sf.saxon.s9api.MessageListenerProxy.characters(MessageListenerProxy.java:92)
                at net.sf.saxon.event.TreeReceiver.characters(TreeReceiver.java:246)
                at net.sf.saxon.event.TreeReceiver.append(TreeReceiver.java:295)
                at net.sf.saxon.expr.instruct.Message$AttributeMasker.append(Message.java:369)
                at net.sf.saxon.expr.instruct.Message.processLeavingTail(Message.java:285)
                at net.sf.saxon.expr.instruct.Instruction.process(Instruction.java:138)
                at net.sf.saxon.expr.instruct.Instruction.evaluateItem(Instruction.java:334)
                at gen_CompiledBlockIterator_132412.next(rsuite:/res/plugin/gao-newblue/xslt/dita2xhtml/dita2htmlImpl.xsl:65535)
                at net.sf.saxon.expr.CardinalityCheckingIterator.<init>(CardinalityCheckingIterator.java:53)
                at CE__Slash__1324051688325951.process(rsuite:/res/plugin/gao-newblue/xslt/dita2xhtml/dita2htmlImpl.xsl:202)
                at com.saxonica.bytecode.CompiledExpression.process(CompiledExpression.java:61)
                at net.sf.saxon.expr.instruct.Template.applyLeavingTail(Template.java:241)
                at net.sf.saxon.trans.Mode.applyTemplates(Mode.java:1063)
                at net.sf.saxon.Controller.transformDocument(Controller.java:2089)
                at net.sf.saxon.Controller.transform(Controller.java:1912)
                at com.rsicms.rsuite.utils.xml.TransformUtils.iTransform(TransformUtils.java:384)


--
Eliot Kimber
http://contrext.com
 




_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[email protected]
https://lists.sourceforge.net/lists/listinfo/saxon-help
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.