Home > Data > XML Output Linkage > Schema Structure > Nillable Nodes

Nillable Nodes

If an XML node is nillable and nothing (not even a missing value) is being written to that node, then the node will still be shown in the XML output file.  For example, suppose you have defined SvcAmt5 and SvcAmt7 to be nillable in your XML Output Linkage schema:
  
...

<xsd:element name="SvcAmts" minOccurs="0">
    <xsd:complexType>
       <xsd:sequence>
          <xsd:element name="SvcAmt1" type="PADecimal" minOccurs="0"/>
          <xsd:element name="SvcAmt2" type="PADecimal" minOccurs="0"/>
          <xsd:element name="SvcAmt3" type="xsd:decimal" minOccurs="0"/>
          <xsd:element name="SvcAmt4" type="xsd:decimal" minOccurs="0"/>
          <xsd:element name="SvcAmt5" type="xsd:decimal" nillable="true"/>
          <xsd:element name="SvcAmt6" type="xsd:decimal" minOccurs="0"/>
          <xsd:element name="SvcAmt7" type="xsd:decimal" nillable="true"/>
          <xsd:element name="SvcAmt8" type="xsd:decimal" minOccurs="0"/>
          <xsd:element name="SvcAmt9" type="xsd:decimal" minOccurs="0"/>
       </xsd:sequence>
    </xsd:complexType>
</xsd:element>

...

As long as one of the non-nillable nodes in the SvcAmts container is being written out (i.e., has a value), you will always see both the
SvcAmt5 and SvcAmt7 nodes in the output -- even if no values were supplied for these nodes:

<SvcAmts>
   <SvcAmt1>10.25</SvcAmt1>
   <SvcAmt5 xsi:nil="true"/> 
   <SvcAmt7 xsi:nil="true"/> 
</SvcAmts>



Note that if the nillable nodes have a PADescription attribute and there is no value (i.e., it's nil), then the PADescription attribute will not be written out to the output XML.

If you try to use minOccurs="0" with nillable="true", then the minOccurs="0" overrides nillable="true" (and so nillable is ignored): this node may not appear in the XML.

Empty vs nillable nodes

If an output field contains a missing value (i.e., a ProAdmin MV), then that node is considered empty. For example, if an empty value has been supplied for SvcAmt7 (using the example above), then <SvcAmt7/> will appear in the XML output file. If no value (not even a missing value) is supplied for an output field, then if the field is nillable, then you'll see <SvcAmt7 xsi:nil="true"/> in the XML output file. If field is not nillable, then nothing (for that output field) will appear in the XML output file.