-
Notifications
You must be signed in to change notification settings - Fork 4
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
XPath: The variable/parameter: $b:v cannot be resolved here, but it may be defined in an external module. #65
Comments
I'm afraid that your test case highlights some laziness in the current solution - there is no namespace-lookup for QNames for referenced variables, functions etc. In fact, the current solution does not track the prefix-namespace binding as it descends down thought the XML tree. It would be quite a bit of work to fix this so I'll have to leave this issue open for the time being but mark it as deferred. |
In my environment, stylesheets for good or for bad use following technique to declare this prefix, and to declare other APIs prefixes:
This technique kills plugin's name resolution. How hard would it be to fix this? Isn't it just a kind of preprocessing of xs:QName value into a string e.g. in format 'Q{namespace}name'? |
It's not that hard to fix in terms of complexity, it's just that there are a lot of QNames that are checked so there will be many code changes so it will take some time. The first part is to change the XML 'parser' so that the current namespace-prefix binding for every node in the XML tree is available. I need to try to do this in a way that minimises the impact on performance/cpu-usage for large files. Given that all xmlns prefixes are tracked already, it may be that the impact is barely noticeable. I will start looking into this but I'm not sure at this stage how long it will take. |
I'm still pondering the solution for this. I think the most pragmatic solution here would be: 'if unable to resolve a function reference using prefix and local-name - fallback to attempting to resolve the function reference by local-name only'. |
In my code base in some cases it might find definition. Wrong one. So, it is silent, worst, kind of error. |
Here is modeled test case:
In real test case I have xsl:param in one file, and use in the other.
Though namespaces are equal, prefixes are different.
Note that similar problem happens with functions defined in different files provided different prefixes are used.
The text was updated successfully, but these errors were encountered: