Main challenge here was to fix the namespace bindings. This PR introduces more complex namespace resolving that should more often 'do what you want'.
These are the rules:
IF there is an instance used in the query -> bind the namespaces to the bindings of the instance element. For the default namespace, look at the xpath-default-namespace attribute. For prefixes, use the xmlns:prefix namespace declarations to resolve them
IF there is no instance used, look at the ancestry of whatever is defining that query, find the closest element with a ref and resolve namespaces from that location. So recurse to the first step.
Thanks @JoernT for the help and the very usable examples!
Main challenge here was to fix the namespace bindings. This PR introduces more complex namespace resolving that should more often 'do what you want'.
These are the rules:
instance
used in the query -> bind the namespaces to the bindings of theinstance
element. For the default namespace, look at thexpath-default-namespace
attribute. For prefixes, use thexmlns:prefix
namespace declarations to resolve themref
and resolve namespaces from that location. So recurse to the first step.Thanks @JoernT for the help and the very usable examples!