Closed UniMars closed 1 year ago
Yes, this is a known issue in lxml that I currently have no good workaround for. See also #89
@regebro If you cannot figure out a good solution for now, why not use a temporary patch like offer a nsmap argment to use my own nsmap?
Replacing None with '' doesn't work, I already tried that, btw. It's still empty.
Although now I got another idea, I'll try that.
@regebro yeah, I also found that, for now, I just delete the none namespace. That's why I advised to allow users to use their own nsmap, at least for some, the none namespace is not required.
The biggest problem is that i have difficult read the source code of how xpath extract and parse namespace dictionary
Right, that's the same idea I just had. It has other side effects, but I think they will be easily fixable.
On Sat, May 20, 2023 at 9:00 PM noctboat @.***> wrote:
@regebro https://github.com/regebro yeah, I also found that, for now, I just delete the none namespace. That's why I advised to allow users to use their own nsmap, at least for some, the none namespace is not required.
— Reply to this email directly, view it on GitHub https://github.com/Shoobx/xmldiff/issues/113#issuecomment-1555972708, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAGIK5FTA2JCS3KTLME7FQDXHEIEFANCNFSM6AAAAAAYI3N3OA . You are receiving this because you were mentioned.Message ID: @.***>
Done
@regebro It seems you fix it in the formatter, but it doesn't work for the main.batch as it doesn't use formatter at all.
Ah.
When I use xmldiff.patch to execute patching, it use xpath to search the node. Because the nsmap of the tree is like {None:'aaaURL','s':"bbbURL"}, the default namespace prefix is None, so the xpath cannot read it. I cannot use my own namespace as input, nor can i edit the nsmap of the tree or transfer None to '' The error message goes like this:
and the xml header is like this: