Thank you for the project. Seem like a bug to me, but not sure, how this is even possible. I think Xojo uses libXML2 and this library is well known (and very old and tested).
May add a ticket with the project for Xojo.
Thank you for the project. Seem like a bug to me, but not sure, how this is even possible. I think Xojo uses libXML2 and this library is well known (and very old and tested).
May add a ticket with the project for Xojo.
It’s a bug.
On import invisible name spaces are added and then you can’t get the attributes.
I’ve done a simple test with the import example from the documentation.
So I have an xml built from string and another one with the root node added.
In the second one I import the first child from the first one documentElement.
I then checked both the attributes and the attribute nodes for the entire tree on both xml starting from the document element.
The one loaded from string attributes and attributes nodes match.
For the imported one I can see more attributes nodes (namespace and the attributes) and getting the attributes directly is impossibile.
More over I build in code the xml starting with a root node it works as expected, BUT if I start with a new XMLDocument I get a namespace (but attributes are readable)
So it’s a bug probably caused by a ghost namespace introduced on import.
This is the reason for the right results with your XML built from the .toString from the imported one.
Thanks for confirming, @Antonio_Rinaldi and @Thomas_Kaltschmidt
Issue filed: https://tracker.xojo.com/xojoinc/xojo/-/issues/79744