Mike Beckerle commented on DAFFODIL-2304:

s6 should be an SDE.

I believe the following is not legal XSD (I checked Walmsley's book XML Schema).

<group name="foo">

    <group ref="bar"/> <!-- group ref cannot be the model group of a group def 

Because this named group has no sequence or choice model group.

By analogy, the DFDL syntax for a hidden group ref is:

<group name="foo2">

  <sequence dfdl:hiddenGroupRef="bar2"/> <!-- group ref cannot be the model 
group of a group def -->
This should also not be allowed. Because you can't change it into an unhidden 
group ref.

So you have to put either a sequence or choice inside a group definition.

While this is true of reusable group definitions and references, the following 
ARE legal:

<complexType name="fooType">

    <group ref="bar"/>

<complexType name="foo2Type">

    <sequence dfdl:hiddenGroupRef="bar"/>

It's not particularly consistent, but these appear to be the rules of XSD.



> hiddenGroupRef in group is dropped during unparse
> -------------------------------------------------
>                 Key: DAFFODIL-2304
>                 URL: https://issues.apache.org/jira/browse/DAFFODIL-2304
>             Project: Daffodil
>          Issue Type: Bug
>    Affects Versions: 2.5.0
>            Reporter: Olabusayo Kilo
>            Priority: Major
>             Fix For: 2.6.0
> HiddenGroupRef's in a group without a sequence tag (i.e s6 instead of s5) 
> will result in s6 being dropped in an unparse test case (see 
> test_ignoredHiddenGroupRefWithNoSequenceParent), with a "DFDL 
> {code:java}
> <xs:group name="s5">
>   <xs:sequence>
>     <xs:sequence dfdl:hiddenGroupRef="ex:s4" />
>   </xs:sequence>
> </xs:group>
> <xs:group name="s6">
>   <xs:sequence dfdl:hiddenGroupRef="ex:s4" />
> </xs:group>
> <xs:element name="e9" dfdl:lengthKind="delimited">
>   <xs:complexType>
>     <xs:sequence dfdl:separator=",">
>       <xs:sequence dfdl:hiddenGroupRef="ex:s6" />
>       <xs:element name="g" type="xs:int"/>
>     </xs:sequence>
>   </xs:complexType>
> </xs:element>
> {code}
> With some preliminary investigating, I narrowed it down to how children are 
> extracted with apparentXMLChildren in SequenceGroup.scala. There may be 
> implications to changing this that needs to be investigated.

This message was sent by Atlassian Jira

Reply via email to