xmltools
xmltools copied to clipboard
Switch to the MSYS2 port of libxml
Seeing as the libxml library is outdated and has a known issue (#17), the library and other dependencies should be updated to the latest release.
Igor Zlatković, the current source of the Windows libraries, had this to say about his ports [via email]:
My Windows port cannot be built any more, except on old platforms. Newer versions of Microsoft C Toolchain cannot link to the system's C runtime (msvcrt.dll). They can only link to their own (incompatible) C runtimes which exist in various versions. According to some opinions (Google for details) distributing such binaries would violate both GPL and Microsoft EULA.
I attempted to distribute builds using GCC, but I am falling behind because I myself do not use Windows or XML any more. There are better maintained ports using the GCC toolchain. The most prominent example would be MSYS2 (msys2.org). It has current, native ports of Libxml and ~1500 other packages.
If it would turn out that my port is still useful and has some advantages over MSYS2 which I do not know about, then I would invest time for it to continue. With information I have now, everyone is better served by MSYS2 port. If I had to use XML on Windows again, I would use MSYS2 port and contribute to it where necessary, rather than revamping my port.
Switching to MSYS2 would also eliminate the requirement of including the source files for the libraries, as the relevant packages are hosted on the MSYS2 repo: libxml2, libxslt, and libwinpthread.
Thanks for the info, I didn't know that this plugin used libxml. I tried to validate a document using new directives from XML 1.1; however, that library does not support this and it's last release is from 2017 :-(
I know only this library, which last release was a couple of days ago and it supports XML 1.1: https://pypi.org/project/xmlschema/#description
The problem is that it is python. It is possible to call python methods from C++: https://www.codeproject.com/Articles/820116/Embedding-Python-program-in-a-C-Cplusplus-code
However, I don't know how easy would be to switch to that library.
I think the best would be to look for a newer library that supports the new XML and XSD versions, and that it is currently been developed.
Xerces-C++ claims to support XML 1.1: http://xerces.apache.org/xerces-c/download.cgi
However is also outdated. Last version from 2018 :-(
Hi,
The last release is 4 days old and is now based on MSXML. Current last release is here: https://github.com/morbac/xmltools/releases/tag/3.0.3.2
Unfortunately, MSXML does neither support XSD 1.1 validation nor XPath 2.0. A solution would be to migrate to another xml api, but it's not an easy job. Moreover, I cannot find valuable candidate with C/C++. As you mention, Xerces-C++ supports XML 1.1, but this wouln't help because it does not support XSD 1.1 (XML 1.1 and XSD 1.1 are not the same). The pypi library is python and not c++. And the XPath engine doesn't look to be 2.0 compatible.
Xerces-Java is much better than Xerces-C++. Xerces-Java supports XSD 1.1, XPath 2.0, and seems to be even faster than Xerces-C++. The main issue is that this is Java. A solution would be to write a XML API wrapper based on Xerces-Java, and then call this wrapper methods from NPP C++ plugin. This suppose to embed a JVM into the NPP plugin. I could find some doc on how to do this (https://developer.ibm.com/technologies/java/tutorials/j-jni/) but I haven't tried it.
So far, a solution for you may be to use the actual pypi validation through a batch command: you can add custom batch commands via by editing %programfiles%\Notepad++\shortcuts.xml (or %appdata%\Notepad++\shortcuts.xml depending on your installation). You can even attach a keyboard shortcut.
Best Regards
Hi morbac
When I said outdated, I didn't mean your plugin. I meant its dependency: libxml, which last release was on November 2017. But anyway, as I understood you, libxml is no longer a dependency, but MSXML.
Yes, you are right about Xerces-Java, I found this too after having posted. It seems that the C++ version isn't that good at all :-(
Thank you for your suggestion about the shortcuts. I will try this.
Best regards Josef