Skip to content

XML parser error for identityref type #703

@ygorelik

Description

@ygorelik

The libyang fails to parse perfectly valid XML file, which we get from Cisco IOS XR router:

<interfaces xmlns="http://openconfig.net/yang/interfaces">
  <interface>
    <name>TenGigE0/0/0/0</name>
    <config>
      <name>TenGigE0/0/0/0</name>
      <type xmlns:idx="urn:ietf:params:xml:ns:yang:iana-if-type">idx:ethernetCsmacd</type>
      <enabled>false</enabled>
    </config>
  </interface>
</interfaces>

The validation by yanglint (latest version 0.15.160) fails too:

yan@ubuntu-yan:~/ydk-workspace/temp/libyang/build$ ./yanglint
> add /home/yan/.ydk/172.27.150.154_830/openconfig-interfaces.yang
> data /home/yan/oc-int.xml
libyang[0]: Invalid value "idx:ethernetCsmacd" in "type" element. (path: /openconfig-interfaces:interfaces/interface[name='TenGigE0/0/0/0']/config/type)
Failed to parse data.
> quit

The file oc-int.xml contains above payload.
Will you be able to fix it?
What is the workaround?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions