Uploaded image for project: 'Daffodil'
  1. Daffodil
  2. DAFFODIL-2183

Unparse nilled complex element fails.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • 2.4.0
    • 2.5.0
    • Back End
    • None

    Description

      This schema uses a nillable complex element.

      <xs:element name="input">
           <xs:complexType>
               <xs:sequence dfdl:separator="%NL;" dfdl:separatorPosition="infix">
                   <xs:element name="person" maxOccurs="unbounded" dfdl:occursKind="implicit" dfdl:initiator="Person:" nillable="true" dfdl:nilValue="%ES;" dfdl:nilValueDelimiterPolicy="initiator">
                       <xs:complexType>
                           <xs:sequence dfdl:separator="," dfdl:separatorPosition="infix">
                               <xs:element name="name" type="xs:string" />
                               <xs:element name="age" type="xs:string" />
                           </xs:sequence>
                       </xs:complexType>
                   </xs:element>
               </xs:sequence>
           </xs:complexType>
       </xs:element>

      Parsing this data:

       

      Person:John Doe,29
      Person:Sally Smith,34
      Person:
      Person:Bob Jones,51

       

       That produces this infoset when parsing:

      <input xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
         <person>
           <name>John Doe</name>
           <age>29</age>
         </person>
         <person>
           <name>Sally Smith</name>
           <age>34</age>
         </person>
         <person xsi:nil="true"></person>
         <person>
           <name>Bob Jones</name>
           <age>51</age>
         </person>
       </input>

      Unparsing dies with error:

      Unparse Error: Element {}person does not have a value.

      Attachments

        Activity

          People

            Unassigned Unassigned
            mbeckerle Mike Beckerle
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: