[YANGTOOLS-879] Allow XPath evaluation to bind variables Created: 02/May/18 Updated: 01/Aug/18 |
|
| Status: | Confirmed |
| Project: | yangtools |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | New Feature | Priority: | Medium |
| Reporter: | Robert Varga | Assignee: | Unassigned |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| 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 ( 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.
|