corenova / yang-js

YANG parser and composer
Apache License 2.0
56 stars 18 forks source link

Unable to import ietf-netconf-monitoring.yang #130

Closed brchiu closed 3 years ago

brchiu commented 3 years ago

When try to import ietf-netconf-monitoring.yang which is widely utilized thus its syntax should be ok.

Yang = require('yang-js') Yang.import('../ietf-netconf-monitoring.yang') However, an error occurred during import.


$ node test2.js
unable to parse '../ORAN-MP-V3/ietf-netconf-monitoring.yang' YANG module from '/home/brchiu/Projects/ORAN-MP-V3/ietf-netconf-monitoring.yang'
/home/brchiu/Projects/learn_yangjs/node_modules/yang-js/lib/node.js:223
          throw e;
          ^

Error [ExpressionError]: [module(ietf-netconf-monitoring)/rpc(get-schema)/output/anyxml(data)] encountered unknown extension 'anyxml'
    at Function.error (/home/brchiu/Projects/learn_yangjs/node_modules/yang-js/lib/element.js:74:17)
    at Function.error (/home/brchiu/Projects/learn_yangjs/node_modules/yang-js/lib/expression.js:149:21)
    at Function.compile (/home/brchiu/Projects/learn_yangjs/node_modules/yang-js/lib/yang.js:166:22)
    at /home/brchiu/Projects/learn_yangjs/node_modules/yang-js/lib/expression.js:66:20
    at Array.forEach (<anonymous>)
    at Function.compile (/home/brchiu/Projects/learn_yangjs/node_modules/yang-js/lib/expression.js:65:20)
    at Function.compile (/home/brchiu/Projects/learn_yangjs/node_modules/yang-js/lib/yang.js:168:22)
    at /home/brchiu/Projects/learn_yangjs/node_modules/yang-js/lib/expression.js:66:20
    at Array.forEach (<anonymous>)
    at Function.compile (/home/brchiu/Projects/learn_yangjs/node_modules/yang-js/lib/expression.js:65:20) {
  uri: 'module(ietf-netconf-monitoring)/rpc(get-schema)/output/anyxml(data)',
  src: <ref *1> [Function: evaluate] Yang {
    description: [Function: evaluate] Yang {
      parent: [Circular *1],
      [Symbol(element:index)]: 0
    },
    parent: <ref *3> [Function: evaluate] Yang {
      anyxml: [ [Circular *1] ],
      parent: <ref *2> [Function: evaluate] Yang {
        description: [Function: evaluate] Yang {
          parent: [Circular *2],
          [Symbol(element:index)]: 0,
          [Symbol(element:cache)]: []
        },
        input: [Function: evaluate] Yang {
          leaf: [ [Yang], [Yang], [Yang] ],
          parent: [Circular *2],
          [Symbol(element:cache)]: [ [Yang], [Yang], [Yang] ],
          [Symbol(element:index)]: 1
        },
        output: [Circular *3],
        parent: <ref *4> [Function: evaluate] Yang {
          namespace: [Function: evaluate] Yang {
            parent: [Circular *4],
            [Symbol(element:index)]: 0,
            [Symbol(element:cache)]: []
          },
          prefix: [Function: evaluate] Yang {
            parent: [Circular *4],
            [Symbol(element:index)]: 1,
            [Symbol(element:cache)]: []
          },
          import: [ [Yang], [Yang] ],
          organization: [Function: evaluate] Yang {
            parent: [Circular *4],
            [Symbol(element:index)]: 4,
            [Symbol(element:cache)]: []
          },
          contact: [Function: evaluate] Yang {
            parent: [Circular *4],
            [Symbol(element:index)]: 5,
            [Symbol(element:cache)]: []
          },
          description: [Function: evaluate] Yang {
            parent: [Circular *4],
            [Symbol(element:index)]: 6,
            [Symbol(element:cache)]: []
          },
          revision: [ [Yang] ],
          typedef: [ [Yang] ],
          identity: [
            [Yang], [Yang],
            [Yang], [Yang],
            [Yang], [Yang],
            [Yang], [Yang],
            [Yang], [Yang],
            [Yang], [Yang]
          ],
          grouping: [ [Yang] ],
          container: [ [Yang] ],
          rpc: [ [Circular *2] ],
          [Symbol(element:cache)]: [
            [Yang], [Yang], [Yang],
            [Yang], [Yang], [Yang],
            [Yang], [Yang], [Yang],
            [Yang], [Yang], [Yang],
            [Yang], [Yang], [Yang],
            [Yang], [Yang], [Yang],
            [Yang], [Yang], [Yang],
            [Yang], [Yang], [Circular *2]
          ]
        },
        [Symbol(element:cache)]: [
          [Function: evaluate] Yang {
            parent: [Circular *2],
            [Symbol(element:index)]: 0,
            [Symbol(element:cache)]: []
          },
          [Function: evaluate] Yang {
            leaf: [Array],
            parent: [Circular *2],
            [Symbol(element:cache)]: [Array],
            [Symbol(element:index)]: 1
          },
          [Circular *3]
        ],
        [Symbol(element:index)]: 23
      },
      [Symbol(element:cache)]: [ [Circular *1] ],
      [Symbol(element:index)]: 2
    },
    [Symbol(element:cache)]: null,
    [Symbol(element:index)]: 0
  },
  ctx: undefined
}