Results 1 to 8 of 8

Thread: Switch XPath functions to use built-in Java library

  1. #1
    Senior Member
    Join Date
    Apr 2018
    Posts
    301

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

  2. #2
    Senior Member
    Join Date
    Apr 2018
    Posts
    301

    Default

    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.

  3. #3
    Developer Veracity's Avatar
    Join Date
    Mar 2006
    Location
    The Unseelie Court
    Posts
    11,862

    Default

    Bump

  4. #4
    Developer
    Join Date
    Aug 2009
    Posts
    2,956

    Default

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

  5. #5
    Developer
    Join Date
    Aug 2009
    Posts
    2,956

    Default

    r19349

  6. #6

    Default

    It looks like that commit doesn't include jdom2.

  7. #7
    Senior Member
    Join Date
    Apr 2018
    Posts
    301

    Default

    Thanks for revisiting this! The commit may have been premature, though, as lostcalpolydude noted.
    Last edited by Saklad5; 06-29-2019 at 01:34 PM.

  8. #8
    Developer
    Join Date
    Aug 2009
    Posts
    2,956

    Default

    r19351 fixes that. Sorry!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •