clarification needed: choice children have separator from surrounding sequence or not?

Consider this textual delimited DFDL schema fragment: <sequence dfdl:separator="/" dfdl:separatorPosition="prefix"> <element name="a" type="xs:string"/> <choice dfdl:initiator="(" dfdl:terminator=")"> <element name="foo" maxOcccurs="10" type="xs:int" dfdl:occursCountKind="parsed" dfdl:terminator=";"/> <element name="bar" type="xs:string" /> </choice> </sequence> Is the separator of the enclosing sequence expected to appear before 'foo' and 'bar' elements inside the choice? If you consider this data '/abc/(/1;/2;/3;/4;)' versus this data '/abc/(1;2;3;4;)' We have to have the / after the abc to find the end of element 'a'. The choice's initiator won't be used as terminating markup. However, then when we have instances of the children of the choice like 'foo' elements, do those have the prefix separator / inherited from the surrounding sequence outside the choice, or do they behave as if surrounded by an inner implied sequence which has no separator? I'm convincing myself that the latter must be the interpretation, but I wanted to see what others think. ...mikeb -- Mike Beckerle | OGF DFDL WG Co-Chair | Tresys Technologies Tel: 781-330-0412

Mike, it's the latter interpretation that is correct. A separator separates the occurrences of the direct child components of the sequence. So your schema models '/abc/(1;2;3;4;)' and my schema models '/abc/(/1;/2;/3;/4;)': <sequence dfdl:separator="/" dfdl:separatorPosition="prefix"> <element name="a" type="xs:string"/> <choice dfdl:initiator="(" dfdl:terminator=")"> <sequence dfdl:separator="/" dfdl:separatorPosition="prefix"> <element name="foo" maxOcccurs="10" type="xs:int" dfdl:occursCountKind="parsed" dfdl:terminator=";"/> </sequence> <element name="bar" type="xs:string" /> </choice> </sequence> Regards Steve Hanson Architect, Data Format Description Language (DFDL) Co-Chair, OGF DFDL Working Group IBM SWG, Hursley, UK smh@uk.ibm.com tel:+44-1962-815848 From: Mike Beckerle <mbeckerle.dfdl@gmail.com> To: dfdl-wg@ogf.org, Date: 12/12/2012 16:19 Subject: [DFDL-WG] clarification needed: choice children have separator from surrounding sequence or not? Sent by: dfdl-wg-bounces@ogf.org Consider this textual delimited DFDL schema fragment: <sequence dfdl:separator="/" dfdl:separatorPosition="prefix"> <element name="a" type="xs:string"/> <choice dfdl:initiator="(" dfdl:terminator=")"> <element name="foo" maxOcccurs="10" type="xs:int" dfdl:occursCountKind="parsed" dfdl:terminator=";"/> <element name="bar" type="xs:string" /> </choice> </sequence> Is the separator of the enclosing sequence expected to appear before 'foo' and 'bar' elements inside the choice? If you consider this data '/abc/(/1;/2;/3;/4;)' versus this data '/abc/(1;2;3;4;)' We have to have the / after the abc to find the end of element 'a'. The choice's initiator won't be used as terminating markup. However, then when we have instances of the children of the choice like 'foo' elements, do those have the prefix separator / inherited from the surrounding sequence outside the choice, or do they behave as if surrounded by an inner implied sequence which has no separator? I'm convincing myself that the latter must be the interpretation, but I wanted to see what others think. ...mikeb -- Mike Beckerle | OGF DFDL WG Co-Chair | Tresys Technologies Tel: 781-330-0412 -- 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