Project

Profile

Help

fn:remove and base-uri?

Added by Anonymous over 19 years ago

Legacy ID: #2955922 Legacy Poster: marcvc (marcvc)

Michael, rather by accident that we ran into this problem using Saxon 8.2. Don't know if there are other scenarios where this can happen, but have the impression it happens at least during the translation of fn:remove into a TailExpression, when the first argument contains somewhere an fn:doc call. Consider the following query: declare base-uri "http://www.w3.org/2001/"; fn:remove(fn:doc("XMLSchema.xsd"), 1) I get: net.sf.saxon.xpath.DynamicError: java.io.FileNotFoundException: D:\dev\Saxon8.2\XMLSchema.xsd (The system cannot find the file specified) Thanks, Marc


Replies (1)

RE: fn:remove and base-uri? - Added by Anonymous over 19 years ago

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

Thanks for reporting this. It affects any expression that gets optimized into a "TailExpression" (another example would be doc(xxx)[position() > 1] where the underlying expression (here a call on doc()) has a dependency on the static context. The fix is to change the analyze method of TailExpression to: public Expression analyze(StaticContext env, ItemType contextItemType) throws XPathException { base = base.analyze(env, contextItemType); return this; } Michael Kay

    (1-1/1)

    Please register to reply