You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Can use XMLPatched with a XML that has XML namespace.
Actual Behavior
Addressing a XML namespace in the Xpath Directive fails.
Steps to reproduce the behavior
The log given by the failure.
Yaapii.Xambly.Error.ImpossibleModificationException : Exception at dir 1: XPATH "/n0:Uos/DataContainer/Part[@uid='Pa__132']/Name" (invalid XPath expr '/n0:Uos/DataContainer/Part[@uid='Pa__132']/Name' (Namespace Manager or XsltContext needed. This query has a prefix, variable, or user-defined function.))
My first idea to solve the bug is to inject a namespace resolver in XMLPatched.
But I don't like the solution because a resolver was already injected to the XML that needs to be patched.
Situation:
I have a XML in my code that needs to work with XPath expressions. I need to inject a namespace resolver to the XML to work with it. Later in the code I need the XMLPatchd object and the resolver again.
It would be nice to have access to the already injected resolver but the current interface design doesn't exposes the resolver. Should we adjust the interface(s)?
What do you think?
I would just test if the xpath contains a namespace prefix and if yes, generate a namespaceresolver based on the xml document's namespaces. Interface adjustment is unnecessary. The resolvers can simply be passed on to new objects through a private or public constructor by the original object.
Expected Behavior
Can use XMLPatched with a XML that has XML namespace.
Actual Behavior
Addressing a XML namespace in the
Xpath Directive
fails.Steps to reproduce the behavior
The log given by the failure.
Yaapii.Xambly.Error.ImpossibleModificationException : Exception at dir 1: XPATH "/n0:Uos/DataContainer/Part[@uid='Pa__132']/Name" (invalid XPath expr '/n0:Uos/DataContainer/Part[@uid='Pa__132']/Name' (Namespace Manager or XsltContext needed. This query has a prefix, variable, or user-defined function.))
Mention any other details that might be useful
Failing example:
The text was updated successfully, but these errors were encountered: