Uploaded image for project: 'yangtools'
  1. yangtools
  2. YANGTOOLS-879

Allow XPath evaluation to bind variables

    XMLWordPrintable

Details

    • New Feature
    • Status: Confirmed
    • Medium
    • Resolution: Unresolved
    • None
    • None
    • None
    • None

    Description

      yang-data-api XPath evaluation should allow for variables to be injected into a compiled expression prior to its evaluation.

      YANG 1.1 specifies an empty variable context, which means that variable references are not useful in the context of YANG validation and would always result in evaluation failure.

      This is not the case when we are allowing pre-compiled queries in scope of MDSAL-50. There we really want the ability to pre-compile a query with variable references and have them injected separately when the query is being evaluated.

      This essentially leads to a expression workflow:

      1) expression defined in terms of yang-model-api (YANGTOOLS-877), gets translated to

      2) expression defined in terms of yang-data-api (YANGTOOLS-878), gets compiled to

      3) org.opendaylight.yangtools.yang.data.api.schema.xpath.XPathExpression

      XPathExpression.evaluate() should then provide QName/value mapping, which is populated into XPath variable binding before the expression is evaluated. Note that implementation-wise this can be treated as a further refinement step, so that variable references in the expression are substituted with their values – at which point we can run constant subexpression elimination and similar optimizations.

       

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              Unassigned Unassigned
              rovarga Robert Varga
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: