Clarification for nil processing and zero length

The DFDL 1.0 spec current says: 9.3.2.1 Simple element If the result is length zero as described above, the representation is then established by checking, in order for: 1. nil representation (if %ES; is a literal nil value). 2. empty representation. 3. normal representation (xs:string or xs:hexBinary only) 4. absent representation (if none of the prior representations apply). But should bullet 1 be: 1. nil representation (if either %ES; or %WSP*; on its own is a literal nil value). I added a test to IBM DFDL and found that setting dfdl:nilKind="literalValue" & dfdl:nilValue="%WSP*;" did not match an element value of empty string. That surprised me, and I think the IBM DFDL code is strictly implementing bullet 1. Using "%WSP*;" is useful for allowing zero or more white space to mean <nil>. I could use "%WSP+; %ES" to achieve the same goal but I'm not sure that was the intent here. Quick response appreciated. Regards Steve Hanson IBM Integration Bus, Hursley, UK Architect, IBM DFDL Co-Chair, OGF DFDL Working Group smh@uk.ibm.com tel:+44-1962-815848 mob:+44-7717-378890 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

My read of 13.16 says that for nilKind 'literalValue' and textual representation, WSP* is already allowed for simple types. So I think nilValue="%WSP*;" should work and match empty string. Delimiters have qualifiers on ES alone and WSP* alone e.g., for separator: "However, the WSP* entity cannot appear on its own as one of the string literals in the list when determining the length of a component by scanning for delimiters, , and it is a schema definition error otherwise. delimiters" (Note the fragment at the end of that sentence. That's a spec. bug) But I see no such stipulation for nilValue. 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 <http://www.ogf.org/About/abt_policies.php> On Fri, Mar 4, 2016 at 6:35 AM, Steve Hanson <smh@uk.ibm.com> wrote:
The DFDL 1.0 spec current says:
9.3.2.1 *Simple element*
If the result is length zero as described above, the representation is then established by checking, in order for:
1. nil representation (if %ES; is a literal nil value).
2. empty representation.
3. normal representation (xs:string or xs:hexBinary only)
4. absent representation (if none of the prior representations apply).
But should bullet 1 be:
1. nil representation (if either %ES; or %WSP*; on its own is a literal nil value).
I added a test to IBM DFDL and found that setting dfdl:nilKind="literalValue" & dfdl:nilValue="%WSP*;" did not match an element value of empty string. That surprised me, and I think the IBM DFDL code is strictly implementing bullet 1. Using "%WSP*;" is useful for allowing zero or more white space to mean <nil>. I could use "%WSP+; %ES" to achieve the same goal but I'm not sure that was the intent here.
Quick response appreciated.
Regards
Steve Hanson *IBM Integration Bus* <http://www-03.ibm.com/software/products/en/ibm-integration-bus>, Hursley, UK Architect, *IBM DFDL* <http://www.ibm.com/developerworks/library/se-dfdl/index.html> Co-Chair, *OGF DFDL Working Group* <http://www.ogf.org/dfdl/> *smh@uk.ibm.com* <smh@uk.ibm.com> tel:+44-1962-815848 mob:+44-7717-378890 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
-- dfdl-wg mailing list dfdl-wg@ogf.org https://www.ogf.org/mailman/listinfo/dfdl-wg

Issue raised: https://redmine.ogf.org/issues/309 Regards Steve Hanson IBM Integration Bus, Hursley, UK Architect, IBM DFDL Co-Chair, OGF DFDL Working Group smh@uk.ibm.com tel:+44-1962-815848 mob:+44-7717-378890 From: Mike Beckerle <mbeckerle.dfdl@gmail.com> To: Steve Hanson/UK/IBM@IBMGB Cc: DFDL-WG <dfdl-wg@ogf.org> Date: 04/03/2016 14:59 Subject: Re: [DFDL-WG] Clarification for nil processing and zero length My read of 13.16 says that for nilKind 'literalValue' and textual representation, WSP* is already allowed for simple types. So I think nilValue="%WSP*;" should work and match empty string. Delimiters have qualifiers on ES alone and WSP* alone e.g., for separator: "However, the WSP* entity cannot appear on its own as one of the string literals in the list when determining the length of a component by scanning for delimiters, , and it is a schema definition error otherwise. delimiters" (Note the fragment at the end of that sentence. That's a spec. bug) But I see no such stipulation for nilValue. 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, Mar 4, 2016 at 6:35 AM, Steve Hanson <smh@uk.ibm.com> wrote: The DFDL 1.0 spec current says: 9.3.2.1 Simple element If the result is length zero as described above, the representation is then established by checking, in order for: 1. nil representation (if %ES; is a literal nil value). 2. empty representation. 3. normal representation (xs:string or xs:hexBinary only) 4. absent representation (if none of the prior representations apply). But should bullet 1 be: 1. nil representation (if either %ES; or %WSP*; on its own is a literal nil value). I added a test to IBM DFDL and found that setting dfdl:nilKind="literalValue" & dfdl:nilValue="%WSP*;" did not match an element value of empty string. That surprised me, and I think the IBM DFDL code is strictly implementing bullet 1. Using "%WSP*;" is useful for allowing zero or more white space to mean <nil>. I could use "%WSP+; %ES" to achieve the same goal but I'm not sure that was the intent here. Quick response appreciated. Regards Steve Hanson IBM Integration Bus, Hursley, UK Architect, IBM DFDL Co-Chair, OGF DFDL Working Group smh@uk.ibm.com tel:+44-1962-815848 mob:+44-7717-378890 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 -- 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
participants (2)
-
Mike Beckerle
-
Steve Hanson