IvanLatysh wrote:
> ...
2) XML element or attribute will not be removed when it's value set
to null
Consider following XML snippets:
<xsd:element name="shipDate" type="xsd:date" nillable="true"/>
...
1) <ship-date calendar="gregorian">2007-01-01</ship-date>
2) <ship-date calendar=""/>
element or attribute will not be removed just because it's value
is null.
...
I strongly disagree. Being absent, and having an empty string value are
completely different things. Font instance, you can't have a "null"
attribute value in XML.
Deleting the property or node and setting the value is a two different
use-cases.
That's true, but the JCR behavior seems harmless to me. The only
alternative that would make sense would be to reject (by throwing an
exception) those requests,
Also JCR API is not consistent in this matter, when consistency is
most important part of any spec.
Here is inconsistence that I refer to:
1) to delete the Node we call: myNode.remove();
2) to delete the Property we call: p.setValue((Value)null);
In the second case I expect to see: p.remove();
You can do that as well, can't you?
=== Proposal ===========================================
* Setting property to NULL will set property value to NULL without any
side effects, such as removing a property.
That would be a major change in the data model. No way.
* To remove a property we call: p.remove();
Item.remove() is already in JCR 1.0.
Best regards, Julian