Feature Switch XPath functions to use built-in Java library

Saklad5

Member
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.
 

Saklad5

Member
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.
 

heeheehee

Developer
Staff member
I'm looking into upgrading htmlcleaner, per #2. It looks like the latest version also depends on jdom2, which in turn depends on jaxen.
 

Saklad5

Member
Thanks for revisiting this! The commit may have been premature, though, as lostcalpolydude noted.
 
Last edited:
Top