complex type with sequence : complexType « XML Schema « XML






complex type with sequence



<?xml version="1.0"?>
<name xmlns="http://www.java2s.com/name"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://www.java2s.com/name Schema.xsd"
  title="Mr.">
  <first>f</first>
  <middle>m</middle>
  <last>l</last>
</name>


File: Schema.xsd

<?xml version="1.0"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema"
  xmlns:target="http://www.java2s.com/name"
  targetNamespace="http://www.java2s.com/name"
  elementFormDefault="qualified">
  <element name="name">
    <complexType>
      <sequence>
        <element name="first" type="string" />
        <element name="middle" type="string" />
        <element name="last" type="string" />
      </sequence>
      <attribute name="title" type="string" />
    </complexType>
  </element>
</schema>

 








Related examples in the same category

1.Define a complexType
2.Definition of a student element uses primitive types for the child elements
3.complexType outside the element
4.Anonymous complex type and sequence
5.Complex type with group reference
6.Complex type with complex content
7.Build Complex type with simple Type
8.complexType with extension
9.complexType with restriction
10.complexType mixed="true"
11.Nested complexType