[Bug 6158] New: Allow attributes to precede elements

http://www.w3.org/Bugs/Public/show_bug.cgi?id=6158

           Summary: Allow attributes to precede elements
           Product: XML Schema
           Version: 1.1 only
          Platform: PC
        OS/Version: Windows NT
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Structures: XSD Part 1
        AssignedTo: cmsmcq@w3.org
        ReportedBy: brille1@hotmail.com
         QAContact: www-xml-schema-comments@w3.org


Hi,

currently attributes must follow sequence, choice, all and group constructs.

This way, creating XML Schema files having a certain degree of hierarchy level
tears pretty much apart a type's definition by separating attributes far away
from the header part:

  <xs:element name="root">
    <xs:complexType>
      <xs:sequence>

              <xs:element name="nextLevel">
                <xs:complexType>
                  <xs:sequence>

                  ...
                  ...
                  ...

                  </xs:sequence>

                  <attribute name="name1" type="xs:string"/>
                  <attribute name="name2" type="xs:string"/>
                  <attribute name="name3" type="xs:string"/>
                </xs:complexType>
              </xs:element>

      </xs:sequence>
      <attribute name="name1" type="xs:string"/>
      <attribute name="name2" type="xs:string"/>
      <attribute name="name3" type="xs:string"/>
    </xs:complexType>
  </xs:element>


I'd very much like to suggest to allow attributes to precede an elements child
definition, like this:

  <xs:element name="root">
    <xs:complexType>
      <attribute name="name1" type="xs:string"/>
      <attribute name="name2" type="xs:string"/>
      <attribute name="name3" type="xs:string"/>
      <xs:sequence>

              <xs:element name="nextLevel">
                <xs:complexType>
                  <xs:sequence>

                  ...
                  ...
                  ...

                  </xs:sequence>

                  <attribute name="name1" type="xs:string"/>
                  <attribute name="name2" type="xs:string"/>
                  <attribute name="name3" type="xs:string"/>
                </xs:complexType>
              </xs:element>

      </xs:sequence>
    </xs:complexType>
  </xs:element>

This way it's even more intuitive to read and perhaps more simple to parse.

www.axeldahmen.de
Axel Dahmen


-- 
Configure bugmail: http://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

Received on Monday, 13 October 2008 16:14:01 UTC