Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check both default namespace and NsXQueryFunc when binding functions #39

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Check both the default namespace and the xpath query namespace for fu…
…nction name resolution
  • Loading branch information
binarycow committed Jul 4, 2021
commit 046ffcbb9d90548e9544aa4044e1ac9a5251fac7
6 changes: 4 additions & 2 deletions src/XPath2/AST/FuncNode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ public sealed class FuncNode : AbstractNode
public FuncNode(XPath2Context context, string name, string ns)
: base(context)
{
_func = FunctionTable.Inst.Bind(name, ns, 0);
_func = FunctionTable.Inst.Bind(name, ns, 0)
?? FunctionTable.Inst.Bind(name, XmlReservedNs.NsXQueryFunc, 0);
if (_func == null)
throw new XPath2Exception("XPST0017", Resources.XPST0017, name, 0, ns);
_name = name;
Expand All @@ -34,7 +35,8 @@ public FuncNode(XPath2Context context, string name, string ns)
public FuncNode(XPath2Context context, string name, string ns, List<object> nodes)
: base(context)
{
_func = FunctionTable.Inst.Bind(name, ns, nodes.Count);
_func = FunctionTable.Inst.Bind(name, ns, nodes.Count)
?? FunctionTable.Inst.Bind(name, XmlReservedNs.NsXQueryFunc, nodes.Count);
if (_func == null)
throw new XPath2Exception("XPST0017", Resources.XPST0017, name, nodes.Count, ns);
_name = name;
Expand Down