Bug #3251
closedPossible error in XSLT when choosing overloaded method in reflexive function
100%
Description
I'm attempting to write a function which will allow me to perform XPath syntax checking (without evaluating the context, in scope prefixes or variables). My initial approach was to use reflexive extension functions and the s9api, as I'm not sure I will have control over the classpath where the function is executed (but I do know it will be using Saxon). I understand that reflexive functions are not ideal but speed is not of particular concern, ease of use is favored in this situation.
My intention was to follow this documentation http://www.saxonica.com/html/documentation/xpath-api/s9api-xpath.html and simply catch a failure to compile(). However, I ran into difficulty creating the Processor. Regardless of the types of the arguments supplied to Processor:new() it always selects the constructor which expects a javax.xml.transform.Source. I've attempted calling Processor:new() with an xs:boolean argument, a java Boolean, and a net.sf.saxon.Configuration argument. This is the error message I get from a -TJ trace while passing in a Configuration:
Finding best fit method for arguments
Trying option 1: public net.sf.saxon.s9api.Processor(javax.xml.transform.Source) throws net.sf.saxon.s9api.SaxonApiException
Conversion preferences are [22]
Trying option 2: public net.sf.saxon.s9api.Processor(net.sf.saxon.Configuration)
Conversion preferences are [80]
Trying option 3: public net.sf.saxon.s9api.Processor(boolean)
Conversion preferences are [80]
Eliminating option 1
Eliminating option 2
Number of candidate methods remaining: 1
Error on line 17 column 89 of check.xpath.xsl:
External object has wrong class (is net.sf.saxon.Configuration, expected javax.xml.transform.Source)
This appears to reject the constructor with the javax.xml.transform.Source signature, then proceeds to generate an error consistent with not rejecting it. Perhaps I'm misinterpreting the trace messages though.
I've attached a stylesheet which triggers this error.
Files
Please register to edit this issue