title: Standard way to represent null attribute values in XML?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/774192/what-is-the-correct-way-to-represent-null-xml-elements">What is the correct way to represent null XML elements?</a>  </p>
  </blockquote>
  
  
  
  <p>Is there a standard way to represent null attribute values in XML?</p>
  
  <p>We have an existing XML format that expects fragments similar to:</p>
  
  <pre><code>&lt;items&gt;
    &lt;item key="key_goes_here" value="value_goes_here" /&gt;
    ...
  &lt;/items&gt;
  </code></pre>
  
  <p>The original format didn't anticipate the need to distinguish between a null value and an empty string value -- however, that is important (now).</p>
  
  <p>My gut says to create a new format that avoids attributes for nullable values, and use elements for them instead:</p>
  
  <pre><code>&lt;items&gt;
    &lt;item key="key_goes_here_and_is_never_null"&gt;
      &lt;value xsi:nil="true" /&gt; 
    &lt;/item&gt;
  &lt;/items&gt;
  </code></pre>
  
  <p>That said, I'd rather keep attributes if there's a <em>standard</em> way to represent null attribute values in XML.</p>