Project

Profile

Help

error code namespace from extension: bug?

Added by Anonymous over 16 years ago

Legacy ID: #4780212 Legacy Poster: Chapman Flack (jcflack)

I was just browsing net/sf/saxon/functions/ExtensionFunctionCall.java in svn, and I noticed the following code in iterate(): } catch (XPathException err) { String msg = err.getMessage(); msg = "Error in call to extension function {" + theMethod.toString() + "}: " + msg; XPathException err2 = new XPathException(msg, err.getException()); err2.setXPathContext(context); err2.setLocator(this); err2.setErrorCode(err.getErrorCodeLocalPart()); throw err2; } I've never tested it, but does this mean that if an extension function throws an XPathException with an error code namespace URI other than the default, the rethrown err2 will have the originally thrown error code local part but the default namespace? Can that be good? Chapman Flack


Replies (1)

RE: error code namespace from extension: bug? - Added by Anonymous over 16 years ago

Legacy ID: #4780258 Legacy Poster: Michael Kay (mhkay)

It's generally the case, I'm afraid, that the concept of error codes being in a namespace is not really very fully implemented in Saxon. Although the exception object can hold a namespace URI, it's very rarely used: it doesn't even appear in standard messages. I'll fix this particular path for the next release, but there's a lot more that needs to be done for namespaced error codes to work properly. Michael Kay http://www.saxonica.com/

    (1-1/1)

    Please register to reply