Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
<element name="example">
 <complexType>
   <sequence>
     <element name="first" type="someComplexType"/>
     <sequence dfdldfdlx:attribute="attr1"/> <!-- gives schema declaration location of attribute data -->
     <element name="second" type="someOtherType"/>
     <sequence dfdldfdlx:attribute="attr2"/> <!-- this attribute is fourth in schema declaration order -->
   </sequence>
   <attribute name="attr1" type="xs:string" use="optional"/> <!-- optional == minOccurs=0, maxOccurs=1 -->
   <attribute name="attr2" type="xs:int" use="required"/> <!-- required == scalar -->
 </complexType>
</element>

<element name="exampleWithEmptyContent">
 <complexType> <!-- no sequences with dfdl:attribute property are needed -->
   <attribute name="attr1" type="xs:string" use="optional"/> <!-- optional == minOccurs=0, maxOccurs=1 -->
   <attribute name="attr2" type="xs:int" use="required"/> <!-- required == scalar -->
 </complexType>
</element>

Properties expressed on a sequence containing dfdldfdlx:attribute would be combined with properties expressed on an XSD attribute declaration.

A dfdldfdlx:attribute annotation element would be defined which can be added as an annotation element to an attribute declaration,  or attribute reference.

...

Attribute groups could also be supported via a dfdldfdlx:attributeGroup property on sequences.

...

  • The QName/NCName given for the dfdldfdlx:attribute="QName" must match an attribute, attribute group, attribute ref, or attribute group ref of that element.
  • A sequence with dfdldfdlx:attribute property cannot be a child of an XSD choice. It can only be the direct child of the sequence group that is the model group of a complex type.
  • DPath expressions need the "@" notation to name attributes.
  • DPath expressions would not allow indexing to retrieve attribute values e.g., ../@attr1[1] would be an SDE.
  • There is no need to allow simple content with attributes. Only empty content with attributes or element-only content with attributes need be supported.
  • Escaping - since attribute values are surrounded with quotation marks (single or double) in XML, those must be escaped if they appear in the content of the attribute value.

...