Skip to content

Help needed with writing and testing a function for Kotlin #4957

Answered by jsotuyod
jborgers asked this question in Q&A
Discussion options

You must be logged in to vote

xpath_funs.yml is just for documentation purposes. To get the function registered you would need to:

  1. override LanguageProcessor createProcessor(LanguagePropertyBundle bundle) in KotlinLanguagemodule to provide your own processor extending BatchLanguageProcessor
  2. in your processor, override XPathHandler getXPathHandler() to return an XPathHandler.getHandlerForFunctionDefs(YOUR_FUNCTION)

You can see how this is done in Java here:

@Override
public LanguageProcessor createProcessor(LanguagePropertyBundle bundle) {
return new JavaLanguageProcessor((JavaLanguagePrope…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@jborgers
Comment options

Answer selected by jborgers
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants