Toolbox
Toolbox

Reputation: 2493

Is it possible to configure Saxon to return variable value and error line

Running towards a testbench that I do not have access to configure, I get the following error.

While processing file file:///Xxx, an exception of type net.sf.saxon.trans.XPathException occurs. Exception message is If the format attribute is present, the {value} property MUST be valid in accordance with the {format input type} property. 

I wonder if its possible to configure Saxon software so it returns the value instead of just showing the text string "{value}". Also, is it possible to configure Saxon to return some estimation of where the error is (line)?

I already asked the service provider of the testbench and they just state that they just forward what the software (Saxon) returns. I currently do not have the information of Saxon version they run.

It's rather cumbersome to look for error and solve them only by having above error. The consequences is that I have to comment-out blocks of code until I find the faulty error which takes unnecessary time.

I do of course understand the area of problem in terms of the relation between the element value and it's defined attribute value and that there is a mismatch there.

Upvotes: 0

Views: 137

Answers (1)

Michael Kay
Michael Kay

Reputation: 163312

Although the exception is an instance of net.sf.saxon.trans.XPathException, which is a Saxon exception class, the message If the format attribute is present, the {value} property MUST be valid in accordance with the {format input type} property. is not a Saxon error message. There is nothing, of course, to stop other software using the Saxon exception class for its own purposes.

Furthermore, it looks as if the message associated with the exception has been wrapped in some further text While processing file file:///Xxx, an exception of type... which also does not come from Saxon.

To discover how to improve the diagnostics here, you'll need to find out (a) where the exception originates (a stack trace would be useful), and (b) what software is catching the and displaying it, and whether that software can be customised.

The answer to the question "Is it possible to configure Saxon to...", as far as this particular error is concerned, is therefore: probably not. There's no evidence that Saxon is involved in either the detection or the reporting of this error.

Upvotes: 1

Related Questions