New XML Plugin for Xojo
Flexibility
By implementing our own classes, we are very flexible on what we support. A lot of utility code we had in various projects to work on xml trees, can now be built-in to the plugin classes and run much faster. Be can also offer more customization on various options.
Unicode support
The new plugin should handle all the unicode details and work well with various text encodings. Usually we use UTF-8 or UTF-16, but we want it to work well with other encodings.
Exceptions
We use exceptions for reporting errors. The exceptions should include all details needed in the message text. As usual our plugin includes for example the index value and the ubound/count value in an OutOfBoundsException.
We like to avoid a couple of common pitfalls, so you can for example freely move nodes between documents. But please avoid recursion in your xml trees.
Efficiency
Our plugin has the potential to be faster on many things. We may offer specialized methods to do operations in C code instead of Xojo code.
We don't just create new objects endlessly, but we recycle them as good as possible. This allows you to compare most objects with the normal = to compare the pointers.
Multi threading
We can implemented threaded loading and saving to help you work on large objects. Let us know if you need that, so we can build a few MT methods for you.
Iterators
We plan to add various iterators, so you can easily loop over items in the DOM tree. That may be a loop over the children in an XML element. Or it could be to loop over all elements with a given tag name within a tree. We already got some Iterate classes to support for each loops in Xojo. And we have XMLNodeIteratorMBS and XMLTreeWalkerMBS classes to loop over hierarchies.
Beta test
The new plugin is at a point, where we can include a first version for the upcoming plugin version 22.4. Then later in the fall we can complete it with further updates. Please try it and let us know. The plugin is very early, so we can still rename things, but most functions should be similar enough to the built-in xml classes, that you can just switch by adding a few MBS to the class names.