AutoPilot variables (java)

  • Sergei Karimov
    Sergei Karimov

    Hi All!
    I'm a new developer for VTD-XML (Java). I have a few questions/reports:
    1. AutoPilot.clearVariableExprs() and clearXPathNameSpaces() may result in NullPointerException if previously was no variables/namespaces. This complicates user code. Please allow to call this methods any time in any object state.
    2. Work with variables via AutoPilot.declareVariableExpr is a bit counterintuitive. You would expect following sequence:
    * (once) compile XPath (with variables)  via selectXPath()
    * (every time) set variable values via AutoPilot.declareVariableExpr()
    * (every time) call AutoPilot.evalXPath() in loop
    Now this sequence is prohibited, because I must provide variable values _before_ calling selectXPath(). So I need to call latter method each time issuing unneeded repeated XPath compile.
    Without mentioned above scenario variable mechanizm is pretty useless.
    BTW default DOM XPath implementation provides correct work with variables using scenario above.

  • jimmy zhang
    jimmy zhang

    This seems like a topic better discussed using emails. Can you post the use case to vtd xml users mailing list and i will reply and exchange our thoughts there?