dfdl:group and dfdl:choice are used as "attribute form" annotations to xs:group and xs:choice respectively. For example:

  <xs:group name="foo">
    <xs:annotation>
      <xs:appinfo source="http://www.ogf.org/dfdl/";>
        <dfdl:group encoding="UTF-8" ... />
      </xs:appinfo>
    </xs:annotation>
    ...
  </xs:group>

Note that the dfdl: prefix isn't need on the encoding property because it is on the dfdl:group element.

The above is equivalent to using "short form" annotations like below, which is the most common form since it is so much less verbose:

  <xs:group name="foo" dfdl:encoding="UTF-8" ... />
    ...
  </xs:group>

Note that the dfdl: prefix is needed here because it is on the xs:group element.

There is also a third form called "element form" which looks like this:

  <xs:group name="foo">
    <xs:annotation>
      <xs:appinfo source="http://www.ogf.org/dfdl/";>
        <dfdl:group>
          <dfdl:property name="encoding">UTF-8"</dfdl:property>
        </dfdl:group>
      </xs:appinfo>
    </xs:annotation>
    ...
  </xs:group>

So instead of being attributes on the xs:group or the dfdl:group annotation, it appears as a dfdl:propery element that is a child of the dfdl:group element.


Each property in the spec lists the annotations it can appear on. For example, the "encoding" property lists these:

Annotation: dfdl:element, dfdl:simpleType, dfdl:sequence, dfdl:choice, dfdl:group

So the "encoding" property can appear on any of those 5 annotations using any of the three property binding forms.

Section 7.1 of the spec lists the different annotations

https://daffodil.apache.org/docs/dfdl/#_Toc62570077

Note that it isn't specific to groups or choices--elements, sequences, simleTypes, etc, have similar annotations.


On 2023-04-26 11:01 AM, Regis Thomas wrote:
Good Morning Daffodil/DFDL Users,

I am working on the development of intellisense for dfdl in the Apache Daffodil VSCode extension.  As we prepare to release version 1.3.0. I am scouring through the Apache DFDL spec https://daffodil.apache.org/docs/dfdl/ <https://daffodil.apache.org/docs/dfdl/> for any items that I have missed implementing in the 1.3.0 release to add to the 1.3.1 release.  I noticed that I was missing the dfdl:choice and dfdl:group elements in the intellisense. From the spec, I don’t understand what element(s) might be parents of these elements.  I also don’t understand what element might be children of these elements or what attributes they might have.  Usually I have been able to find examples of an element’s use that helped clarify how I might add that element to the intellisense, but I haven’t been able to find any examples of either dfdl:choice or dfdl:group in use. If anyone could provide an example or additional clarification, that would be greatly appreciated.

Regis Thomas

Nteligen, LLC

6716 Alexander Bell Drive,

Suite 120

Columbia, MD 20146

(240) 864-5042 x126

regis.tho...@nteligen.com


Reply via email to