• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Anything wrong with this schema?

lozina

Lifer
I created a xml schema which we've been using for a while and now another application is looking to integrate with us and I sent them the schema and they are saying the schema is no good, that they cannot import it into their tool.

I am thinking their tool has a bug but I dont know, can you guys tell me if this schema syntax is no good? (renamed elements)

(see below next post)

They say everything imports fine until they get to the elements inside the choice section - that the address and group dont show up properly.

Basically the point of the way it is structured is that basicdata is required and shows up only once, while the stuff under the choice are optional, can occur one or more times, and the order does not matter.
 
Last edited:
Code:
[FONT=&quot]<xs:element name="customers">
  <xs:complexType>
    <xs:sequence>  
      <xs:element name="customer" minOccurs="1">  
        <xs:complexType>    
          <xs:sequence>      
            <xs:element ref="[/FONT]basicdata[FONT=&quot]"/>
            <xs:choice minOccurs="0" maxOccurs="unbounded">
              <xs:element ref="address" minOccurs="0"/>
              <xs:element ref="group" minOccurs="0"/>
            </xs:choice>
          </xs:sequence>
          <xs:attribute name="id" type="xs:int"/>
        </xs:complexType>
      </xs:element>
    </xs:sequence>
  </xs:complexType>
</xs:element>[/FONT]

whoops meant to edit OP sorry
 
I don't think xs:choice works that way. What you want is:

Code:
<xs:element name="customers">
  <xs:complexType>
    <xs:sequence>  
      <xs:element name="customer" minOccurs="1">  
        <xs:complexType>    
          <xs:sequence>      
            <xs:element ref="basicdata"/>
            <xs:element ref="address" minOccurs="0" maxOccurs="unbounded"/>
            <xs:element ref="group" minOccurs="0" maxOccurs="unbounded"/>
          </xs:sequence>
          <xs:attribute name="id" type="xs:int"/>
        </xs:complexType>
      </xs:element>
    </xs:sequence>
  </xs:complexType>
</xs:element>
 
Last edited:
Back
Top