As simple content models : simpleContent « XML Schema « XML Tutorial






<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
  targetNamespace="http://www.java2s.com" xmlns="http://www.java2s.com"
  elementFormDefault="qualified">

  <xs:simpleType name="empty">
    <xs:restriction base="xs:string">
      <xs:enumeration value="" />
    </xs:restriction>
  </xs:simpleType>
  <xs:element name="br">
    <xs:complexType>
      <xs:simpleContent>
        <xs:extension base="empty">
          <xs:attribute name="id" type="xs:ID" />
          <xs:attribute name="class" type="xs:NMTOKEN" />
        </xs:extension>
      </xs:simpleContent>
    </xs:complexType>
  </xs:element>
</xs:schema>








3.54.simpleContent
3.54.1.The simpleContent element is used if the complex type may only have text content
3.54.2.Defining Elements to Contain Only Text
3.54.3.Creating Elements with Simple Content and Attributes
3.54.4.element based on simple type
3.54.5.As simple content models