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

Leaf of type union containing identity-ref is not correctly transformed to XML

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Medium Medium
    • 3.0.12, 5.0.3, 4.0.10
    • None
    • None
    • None

      If some leaf has type union, which is containing also identity-ref, NormalizedNode with filled this leaf with some identity is not correctly rendered to XML.

      E.g.:

       

      module foo {
        namespace "foo-namespace";
        prefix "f";
        identity ident-base;
        identity ident-one {
          base ident-base;
        }
      
        ...
        leaf union-identityref-leaf {
          type union-type;
        }
      
        leaf identityref-leaf {
          type identityref {
            base ident-base;
          }
      
        }
      
        ...
      }

       

       

      If both leaves will have set as value identity ident-one, the XML converted output will be following:

      <identityref-leaf>ident-one</identityref-leaf>
      <union-identityref-leaf>(foo-namespace)ident-one</union-identityref-leaf>

      The leaf identityref-leaf is converted correctly, but union-identityref-leaf with union has string QName included, which will not be converted using opposite direction.

            rovarga Robert Varga
            apuchyova Anna Bencúrová
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: