Project

Profile

Help

Cannot get error code for error() call

Added by Lars Marius Garshol 7 months ago

I'm running Saxon both via the API and via the command-line. Same input, same stylesheets.

When I run it on the command-line I get the following:

Error - Missing required document reference:
Error at char 7 in expression in xsl:value-of/@select on line 2278 column 45 of common-sts.xsl:
  ROPS1002  Error signalled by application call on error()
In template c:message on line 2262 column 45 of common-sts.xsl:
     invoked by xsl:call-template at file:/Users/larsga/cvs-co/render/support/augment.xsl#613
In template c:documentReference on line 604 column 66 of augment.xsl:
     invoked by xsl:call-template at file:/Users/larsga/cvs-co/render/support/toc.xsl#607
In template c:bookmarks on line 582 column 34 of toc.xsl:
     invoked by xsl:call-template at file:/Users/larsga/cvs-co/render/support/Core-sts2fo-a4-base.xsl#351
  In template rule with match="/" on line 300 of Core-sts2fo-a4-base.xsl
     invoked by xsl:next-match at file:/Users/larsga/cvs-co/render/support/Core-sts2fo-a4-base.xsl#271
  In template rule with match="/" on line 209 of Core-sts2fo-a4-base.xsl
Error signalled by application call on error()

When I run it via the API I do this before starting my transform:

      transformer.clearParameters();
      transformer.setMessageListener(listener);

My message listener is:

  public void message​(XdmNode content, QName errorCode, boolean terminate,
                      SourceLocator locator) {
    messages.add("XSLT MESSAGE: " + errorCode + "\n" +
                 content.getStringValue() + "\n" +
                 locator.getSystemId() + ":" + locator.getLineNumber());

    if (terminate) {
      throw new XmlServerException("Transform aborted by xsl:message", this);
    }
  }

The problem is I get this output:

XSLT MESSAGE: XTMM9000
Error - Missing required document reference:
file:/Users/larsga/cvs-co/render/support/common-sts.xsl:2267

For some reason the error code is not correct, and getting this error code is important, so that I know how to correctly report the error to end users.

Any idea what is going on here?


Replies (1)

RE: Cannot get error code for error() call - Added by Lars Marius Garshol 7 months ago

I'm sorry. You can ignore this. There must be something else going on.

    (1-1/1)

    Please register to reply