Switch XPath functions to use built-in Java library
Right now, the xpath() function uses HtmlCleaner’s implementation. Unfortunately, that implementation is not standards-compliant at all, and is missing the vast majority of XPath 1.0’s capabilities. Java’s built-in library has a complete implementation, so we should rewrite the code in RuntimeLibrary.java to use that.
I was chatting with Ezandora about it, and she actually found a discussion where one of HtmlCleaner’s developers recommended against using their implementation for most purposes.
I might be able to implement this change myself, piping cleaned HTML from HtmlCleaner into the built-in functions and leaving everything else intact. It depends on how busy I prove to be, and how complicated the typecasting is.
Could we update HtmlCleaner to the latest version? The KoLmafia instance appears to be missing a function that can convert HtmlCleaner objects to DOM objects, which would make this much easier.