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

XPath: XPath keyword not accepted as valid XPath expression

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • Highest
    • Resolution: Done
    • 6.0.0, 7.0.0, 6.0.8, 7.0.9
    • 8.0.0, 6.0.9, 7.0.11
    • xpath

    Description

      If data node is one of the XPath keywords (and, div, mod, or), then the data node name alone is not considered a valid XPath expression.

      For example, the following data model is not accepted because and is not a valid XPath expression based on the Antlr specification used by Yangtools:

      module xpath-test {
        yang-version 1.1;
        namespace "urn:opendaylight:must-test";
        prefix "mt";
      
        revision "2021-12-16";
      
        container foo {
          list bar {
            key "baz";
            must "and";
            leaf baz {
              type string;
            }
            list and {
              key "baz";
              leaf baz {
                type string;
              }
            }
          }
        }
      }
      

      And there is such a data model actually used by Cisco routers (Cisco-IOS-XR-um-router-pim-cfg.yang), and this is preventing Silicon or later version from mounting the devices.

      Attachments

        Issue Links

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

          Activity

            People

              rovarga Robert Varga
              sangwookha Sangwook Ha
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: