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

XML parser omits leading/trailing whitespace in string values

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Medium Medium
    • 11.0.1, 9.0.9, 10.0.9
    • None
    • codecs
    • None

      tested with karaf 18.1

      In yang model we have a leaf declared as the following

       

      leaf myLeaf {     
        type string {
          length "1..4";
        }
      }
      

       

      Case 1)

      The leaf is filled with the value="    "

      i.e. with four empty spaces:

      <myLeaf>    </myLeaf>

      ODL raises an error for this case,

      because all spaces are removed and the length constraint is not satisfied.

      Case 2)

      The leaf is filled with four empty encoded spaces, each space is encoded using a xml entity, using & plus #160;

      ODL does not raise error,

      but the json return by ODL

      contains non printable characters,

      the encode spaces are not decoded back to plain spaces ...

       

       

       

       

       

            rovarga Robert Varga
            brigam Maurizio Brigandi'
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: