WebSphere Message Brokers
File: ad06720_
Writer: Terry Cowling

Reference topic

This build: July 31, 2007 21:22:49

XML Null handling options

The XML Wire Format supports the handling of null values within messages. Encoding null properties for XML are set only on the message set and apply to all the defined objects within the message set.

You can use the following two properties to represent the numeric and non-numeric encoding for NULL within the XML Wire Format:

These represent the numeric and non-numeric encoding for NULL respectively.

Each of these encodings has the following enumerated values:

You do not have to supply additional information for NULLEmpty, NULLXMLSchema and NULLValueAttribute, but if you select NULLValue, NULLAttribute, or NULLElement, you must define further values to be assigned to represent the NULL condition in the Encoding Numeric Null Value and Encoding Non-Numeric Null Value message set properties.

The following table shows how each encoding works. For each encoding, the example XML will cause the element myElem to be given a value NULL:

Notes:
  1. The value of Boolean True is used.
  2. This is only valid for XMLElementAttrVal element rendering, as specified in XML rendering options. Marking an element as being rendered in this way, and setting it to null, is equivalent to removing the attribute of the element that detailed the element's value.
  3. This is only valid for XMLElementAttrIdVal element rendering, as specified in XML rendering options. Marking an element as being rendered in this way, and setting it to null, is equivalent to removing the attribute of the element that detailed the element's value, but not removing the attribute id.

Encoding Numeric Null
Encoding Non-Numeric Null

Encoding Numeric Null Value
Encoding Non-Numeric Null Value

Example XML
NULLEmpty  
<myElem/>
<myElem></myElem>
NULLValue zzz <myElem>zzz</myElem>
NULLXMLSchema   <myElem xsi:nil='true'/>1
NULLValueAttribute  
<myElem></myElem>2
<parent id="myElem"></parent>3
NULLElement null4 <myElem><null/></myElem>
NULLAttribute null4 <myElem null='true'/>1
Notes:
  1. The attribute must evaluate to true, so the value must be either "true", "1" or the Boolean True Value property.
  2. This is only valid for XMLElementAttrVal element rendering, as specified in XML rendering options. Marking an element as being rendered in this way, and setting it to null, is equivalent to removing the attribute of the element that provides the element's value.
  3. This is only valid for XMLElementAttrIdVal element rendering, as specified in XML rendering options. Marking an element as being rendered in this way, and setting it to null, is equivalent to removing the attribute of the element that provides the element's value, but not removing the attribute that provides the element's name.
  4. Both NULLElement and NULLAttribute are deprecated. The element or attribute name provided should not include a namespace URI or prefix. If namespaces are enabled for the message set then the name matches any namespace.

You do not have to supply additional clarification for NULLEmpty and NULLValAttr, but if you select NULLValue, NULLAttribute, or NULLElement, you must define further values to be assigned to represent the NULL condition in the Encoding Null Num Value and Encoding Null Non-Num Value message set properties (see the table above).

Related concepts
Message modeling
The message model
MRM XML physical format: relationship to the logical model
Related tasks
Developing message models
Working with message model objects
Related reference
Message model reference information
Message model object properties
Additional MRM domain information
Additional XML information
XML Null value
XML Null representation for Binary data
XML Wire Format message set properties
Notices | Trademarks | Downloads | Library | Support | Feedback

Copyright IBM Corporation 1999, 2007Copyright IBM Corporation 1999, 2007. All Rights Reserved.
This build: July 31, 2007 21:22:49

ad06720_ This topic's URL is: