
I went back to an old ibm-internal document and found a discussion that this property is used only to control output. Is this still true? This is my logic about this: I.e., useNullValueForDefault applies only to nullable items, and an element is required and if nothing is in the logical value when you output, then it "defaults it" by filling in the logical value with null, and then of course when outputting that, the null is represented however it is represented. On input, if an element is required but is not present in the data at all, and it has a default value normally that would used as the logical value. useNullValueForDefault can either be used in this situation to mean that the default value is to be null (which can't be expressed in the XSD default="..." syntax), or one can say this is ignored on input, and the user achieves this affect by putting empty string on the list of nullValues, and not having any default value. We need to reexamine this nullValues as a list thing, That may or may not be sufficient, but no matter what one certainly needs to be able to indicate that empty-string means null, so there's no need for useNullValueForDefault on input. Mike Beckerle STSM, Architect, Scalable Computing IBM Software Group Information Platform and Solutions Westborough, MA 01581 direct: voice and FAX 508-599-7148 assistant: Pam Riordan priordan@us.ibm.com 508-599-7046 Geoff Judd <JUDDG@uk.ibm.com> 12/03/2007 05:16 AM To Mike Beckerle/Worcester/IBM@IBMUS cc dfdl-wg@ogf.org, dfdl-wg-bounces@ogf.org Subject Re: [DFDL-WG] OGF DFDL - useNullValueForDefault Mike, The think the primary motivation for the useNullValueForDefault is to allow out-of-band values to be output as default values. A default value has to be in the value space of the missing element but a Null value can be an out-of-band value. One scenario where useNullForDefaultValue is useful is in the case of COBOL where a user wants to output HIGH-VALUES or LOW-VALUES for missing elements. Regards, Geoff Judd WebSphere Message Brokers Development IBM United Kingdom Ltd. Hursley Telephone: +44-1962-818461 E-mail: JUDDG@uk.ibm.com Mike Beckerle <beckerle@us.ibm.com> Sent by: dfdl-wg-bounces@ogf.org 30/11/2007 20:34 To dfdl-wg@ogf.org cc Subject [DFDL-WG] OGF DFDL - useNullValueForDefault I'm trying to simplify something in the nulls/defaults space. There's this property proposed: useNullValueForDefault. This is a boolean. I'm trying to understand what this is for. On input, when the element is required but no content is found, and you therefore want to create a default value, you would look, see that the element is nillable, see that useNullValueForDefault is true, and set the logical value of that element to null. On output when no logical value is provided but the element is required, you therefore want to create a default value, so you look and see that the element is nillable and see that useNullValueForDefault is true and so you provide the logical value null as the value. Then you output as if the logical value was null in the first place, so you would output the first of the dfdl:nullValues list as the representation. These two are not symmetric. I understand wanting empty content to cause null as the logical value of a nillable element. Symmetry argues that one wants in this case for the output side to output empty content as the representation of null logical value. The way I would express this is to provide a means for the list of dfdl:nullValues to be able to contain the empty string as its first member of the list. E.g., some syntax like: dfdl:nullValues=" '' 'null' 'NULL' '\ ' " Once you have this, there is no need for useNullValueForDefault. It's functionality is subsumed by allowing nullValues to contain empty-string as a null representation. This leaves the case where an element is both nullable and has a non-null default value. Is this case important or can we just say that an element is either nullable or has default values, but not both. We already have some constraints on this stuff in that we don't allow nullable complex types, only simple. I believe allowing all combinations of nullability with default values is probably overkill. Comments? I understand wanting a missing Mike Beckerle STSM, Architect, Scalable Computing IBM Software Group Information Platform and Solutions Westborough, MA 01581 direct: voice and FAX 508-599-7148 assistant: Pam Riordan priordan@us.ibm.com 508-599-7046 -- dfdl-wg mailing list dfdl-wg@ogf.org http://www.ogf.org/mailman/listinfo/dfdl-wg Unless stated otherwise above: IBM United Kingdom Limited - Registered in England and Wales with number 741598. Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU