Hi Bob,

I was under the impression that XML readers tend to treat a missing attribute 
the same as an empty attribute i.e. there is no way to tell the difference 
between them.  Is that not the case?

Regards
Scott

HotWax Media
http://www.hotwaxmedia.com

On 22/01/2010, at 9:30 AM, Bob Morley wrote:

> 
> We ran into a situation where we had a previously created seeded entity who
> had a field value that we wanted to change to null.  The current data load
> process would take values from the data files and if the field value was set
> to either empty string OR was not present, would ignore this field
> attribute.  The net result, was that there was no way to get "null"
> populated on the entity via the standard data load update mechansim.
> 
> As a result, I created this ticket OFBIZ-3421 with a small fix that would
> treat something like :
> 
>    <ProductSubscriptionResource 
>        productId="DNSZONE" subscriptionResourceId="DNSZONE"
> fromDate="2009-01-01 00:00:00.0" 
>       useTime="1" useTimeUomId="TF_mon" 
>        useCountLimit="null"
>       canclAutmExtTime="1" canclAutmExtTimeUomId="TF_day"
>       useRoleTypeId="CUSTOMER" 
>       automaticExtend="Y"/>
> 
> As updating the useCountLimit to null on update.  Upon further discussion,
> the thought was that perhaps we should change how Ofbiz treats elements that
> are explicitly set to "" so that they are treated as null in general (rather
> than being ignored like they are not specified at all).
> 
> What I am saying here is the current data load would treat useCountLimit=""
> exactly the same as if useCountLimit was not specified at all.  And we are
> suggesting that useCountLimit="" should really be treated as updating to
> null so that a previous value would be reset to null.
> 
> That would prevent the "hack-like" feeling I am getting from treating "null"
> as some sort of keyword which is what I had done in this resolution.
> 
> The net result of this, is that we would likely have to blow through about
> 1400 instances of *Data.xml files that are explicitly setting fields to =""
> since it is likely that they really want them ignored.
> -- 
> View this message in context: 
> http://n4.nabble.com/Supporting-null-in-data-load-update-tp1100195p1100195.html
> Sent from the OFBiz - Dev mailing list archive at Nabble.com.

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to