An element may be named and defined globally. : element « XML Schema « XML Tutorial






<xsd:schema
  targetNamespace=
  "http://www.java2s.com/namespace/employees"
  xmlns="http://www.java2s.com/namespace/employees"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  elementFormDefault="qualified">

  <xsd:element name="employees">
   <xsd:complexType>
    <xsd:sequence>
     <xsd:element ref="firstName"/>
     <xsd:element ref="middleName"/>
     <xsd:element ref="lastName"/>
    </xsd:sequence>
   </xsd:complexType>
  </xsd:element>
  <xsd:element name="firstName" type="xsd:string"/>
  <xsd:element name="middleName" type="xsd:string"/>
  <xsd:element name="lastName" type="xsd:string"/>

</xsd:schema>








3.89.element
3.89.1. Declarations
3.89.2.An element may be named and defined locally.
3.89.3.An element may be named and defined globally.
3.89.4.Element Declarations