Yes the daffodil unparser faults if a defaultable element does not exist in the infoset.

We've gotten away with this for now as most of our use cases are data being round-tripped, parsed, inspected/redacted, then unparsed. So defaultable elements will have been inserted to the infoset by the parse process.

Interestingly, for elements with dfdl:outputValueCalc we've found we have to tolerate, but ignore the value of such elements if present in the infoset. They are overwritten when unparsing by the newly computed value.
It's far too painful to have to remove them before unparsing.

Mike Beckerle | OGF DFDL Workgroup Co-Chair | Tresys Technology | www.tresys.com
Please note: Contributions to the DFDL Workgroup's email discussions are subject to the OGF Intellectual Property Policy



On Wed, Nov 27, 2019 at 11:25 AM Steve Hanson <smh@uk.ibm.com> wrote:
OK so that sounds fine.

Similar concern for unparsing though. What happens today if I omit a required occurrence from the infoset, but there is a default value on the element declaration? Hopefully you give an error rather than just continuing.

Regards
 
Steve Hanson

IBM Hybrid Integration, Hursley, UK
Architect,
IBM DFDL
Co-Chair,
OGF DFDL Working Group
smh@uk.ibm.com
tel:+44-1962-815848
mob:+44-7717-378890
Note: I work Tuesday to Friday




From:        Mike Beckerle <mbeckerle.dfdl@gmail.com>
To:        Steve Hanson <smh@uk.ibm.com>
Cc:        DFDL-WG <dfdl-wg@ogf.org>
Date:        22/11/2019 19:43
Subject:        [EXTERNAL] Re: [DFDL-WG] New Experimental Feature document: dfdl:emptyElementParsePolcy






Actually daffodil doesn't insert defaults when parsing, it creates the element, having no value, and then on-demand, when accessed, the value is pulled from where we save it in the static runtime data structures, and is saved as the element's value.  This can happen when an expression refers to the element, or when the data set is subsequently output as some other representation like JSON or XML.

So we *are* somehow doing defaults when parsing. Just not at the time the parser traverses the element.  For all intents and purposes we are doing defaulting during parsing. Not unparsing yet though.

Mike Beckerle | OGF DFDL Workgroup Co-Chair | Tresys Technology | www.tresys.com
Please note: Contributions to the DFDL Workgroup's email discussions are subject to the OGF Intellectual Property Policy



On Fri, Nov 22, 2019 at 11:57 AM Steve Hanson <smh@uk.ibm.com> wrote:
Mike

The new document looks good, the descriptions of the property values are clear and simple.


One comment of yours I need to follow up though. You said:


"
Bug in this doc. Daffodil is not inserting defaults here (doesn’t implement default insertion when parsing.)  Fixed with new language you suggested. "

Are you saying that if Daffodil parses an occurrence and determines it has the empty rep, and there is a default value on the element declaration, that the default value is not used?  If so then what happens?  Further, if you subsequently change Daffodil so it does use the default value, you have silently changed parsing behaviour in an incompatible way. IBM DFDL similarly does not use default values when parsing, but to prevent a future incompatible behaviour change, if we find a zero-length occurrence and there is a default value, we throw a runtime SDE.


Regards
 
Steve Hanson

IBM Hybrid Integration, Hursley, UK
Architect,
IBM DFDL
Co-Chair,
OGF DFDL Working Group
smh@uk.ibm.com
tel:+44-1962-815848
mob:+44-7717-378890
Note: I work Tuesday to Friday




From:        
Mike Beckerle <mbeckerle.dfdl@gmail.com>
To:        
Steve Hanson <smh@uk.ibm.com>
Cc:        
DFDL-WG <dfdl-wg@ogf.org>
Date:        
16/10/2019 19:19
Subject:        
[EXTERNAL] Re: [DFDL-WG] New Experimental Feature document: dfdl:emptyElementParsePolcy





I have revised this per your comments, and uploaded a new revision. Link:
https://redmine.ogf.org/dmsf_files/13596?download=


Mike Beckerle | OGF DFDL Workgroup Co-Chair | Tresys Technology |
www.tresys.com
Please note: Contributions to the DFDL Workgroup's email discussions are subject to the
OGF Intellectual Property Policy



On Wed, Oct 16, 2019 at 12:23 PM Steve Hanson <
smh@uk.ibm.com> wrote:
Mike


Some significant comments on this.




Regards
 
Steve Hanson

IBM Hybrid Integration, Hursley, UK
Architect,
IBM DFDL
Co-Chair,
OGF DFDL Working Group
smh@uk.ibm.com
tel:+44-1962-815848
mob:+44-7717-378890
Note: I work Tuesday to Friday




From:        
Mike Beckerle <mbeckerle.dfdl@gmail.com>
To:        
DFDL-WG <dfdl-wg@ogf.org>
Date:        
14/10/2019 19:58
Subject:        
[EXTERNAL] [DFDL-WG] New Experimental Feature document:        dfdl:emptyElementParsePolcy
Sent by:        
"dfdl-wg" <dfdl-wg-bounces@ogf.org>




Per one of our trackers I uploaded an "official" document to describe this experimental feature.

gwde-dfdl-experience-7-emptyElementParsePolicy.docx

This describes the feature as we have implemented it in Daffodil. There has been some discussion on this proposal already, particularly on whether the enum values for the property are appropriately chosen so that they clearly identify the different behaviors.

Mike Beckerle | OGF DFDL Workgroup Co-Chair | Tresys Technology |
www.tresys.com
Please note: Contributions to the DFDL Workgroup's email discussions are subject to the
OGF Intellectual Property Policy
--
 dfdl-wg mailing list
 
dfdl-wg@ogf.org
 
https://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


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


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