Hi Mukul, Mukul Gandhi <[email protected]> wrote on 11/12/2009 11:09:24 PM:
<snip/> > You rightly said, that XPath 2 static context should provide a > "Default function namespace" binding as well (described at this link > which you cited, http://www.w3.org/TR/xpath20/#dt-def-fn-ns). To > answer your following questions: > > <question> > XPath 2.0 processor should allow you to set it to anything, so can't > see how it could be working correctly without having code somewhere in > Xerces which explicitly sets that on PsychoPath. > > In other words a call like: > > fDynamicContext.set_default_function_namespace("http://www.w3.org/ > 2005/xpath-functions"); > > or whatever the method is in PsychoPath for specifying it. > </question> > > This can be achieved by simply not specifying any namespace binding > for the URI http://www.w3.org/2005/xpath-functions in Xerces-J java > code. > > i.e, simply removing this method call in, AbstractPsychoPathImpl.java > > fDynamicContext.add_namespace("fn", "http://www.w3.org/2005/xpath-functions"); > > will fix this issue. This statement simply needs to be removed, to > comply to the spec, as you stated. So the fix for this problem, seems > to be very trivial :) That is the part that still doesn't make sense to me. How is PsychoPath determining what the "default function namespace" is? Magic? :-) We don't set it anywhere. Put another way, if XML Schema provided a way for users to specify the default function namespace (e.g. another attribute like xpathDefaultNamespace but applies to function names instead of element names) how could you set it with PsychoPath? Is this something that's missing from its API? Thanks. Michael Glavassevich XML Parser Development IBM Toronto Lab E-mail: [email protected] E-mail: [email protected]
