Binding to the Xerces-C++ XML parser: who is interested / help welcome

I am interested in having a binding to the Xerces-C++ XML parser to use its SAX interface and for validation of XML documents against DTDs and W3C schemas. That binding should run at least on the following platforms: macOS on Intel, macOS on Apple Silicon, Windows on Intel (x64), and Red Hat 7 on Intel (x64).

I have already put some work into it, but first: Why would I want to do that? Well, Xerces (Xerces-C++ or Xerces-J, the last one being part of every Java distribution) is considered by many as the "gold standard" for XML parsing, and other than libxml2 it has complete support for W3C schemas (libxml2 has support for Relax NG, which Xerces does not have, but unfortunately Relax NG is not widely used, despite being a really good schema language).

...and more generally : Why is XML still an important format? The more precise question should be: Why is some simpler handling of XML e.g. via the Swift Foundation library not good enough (not to mention the cases where JSON would be a better option)? The answer is: There are still a large number of large documents in XML format, and many of the applications that handle them need some of the complexity involved. So XML is still an important topic.

So what is the state of this project: The binding (in an incomplete state, but this is not a problem and easily made complete when other problems are resolved) is functional in form of an Xcode project (not Swift Package Manager) where the Xerces-C++ dynamic library is included as part of the project. The binding uses some Objective-C, as the C++ binding to Swift is not ready yet for production. But as a Swift package, this does not work yet: It cannot use the content of the Xerces-C++ dynamic library. I have some public repositories which are listed at the end of this post, please refer to the READMEs of those repositories for more information.

Why am I posting this here: Maybe you are also interested in such a binding to Xerces-C++ and want to help. Of course, even if you are not really interested in this use case: any help is welcome! I do not think I am that far from a solution, but I definitely could use some help (@George already helped, and @lukasa has some good suggestions about what a good way would be to include binaries in Swift packages not only on Apple platforms, see this topic).

What are the alternatives: Of course, an alternative for XML parsing is always libxml2, which is fast and only written in C. In my projects, I would then use a preprocess written in C++ that uses Xerces-C++ if I have to validate against a W3C schema. So: Having a binding to Xerces+C++ is still very valuable for me, but if this does not work or is really a lot of work, well: maybe than I (and anyone else) should not put too much work into it. And maybe it will be easier later when including binaries in Swift packages is in a more advanced state, see there. ... So I would be happy to get some help here, but maybe the time is not right yet for this... (Or there will be an alternative written in Swift, maybe a port of some parts of Xerces?...)

The public repositories are:

GitHub - cezheng/Fuzi: A fast & lightweight XML & HTML parser in Swift with XPath & CSS support ?

Thanks @Joakim_Hassila1, I will certainly have a look at that.

Terms of Service

Privacy Policy

Cookie Policy