AutoPilot variables (java)

  • Sergei Karimov

    Sergei Karimov - 2012-11-25

    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 - 2012-11-27

    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?


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks