<xsd:simpleContent> Element

Contains extensions or restrictions on a complexType element with character data or a simpleType element as content and contains no elements.

  id = ID 
  {any attributes with non-schema Namespace}...>
Content: (annotation?, (restriction | extension))


The ID of this element. The id value must be of type ID and be unique within the document containing this element.


Element Information


Number of occurrences

One time

Parent elements



Optional — annotation

Required — One and only one of the following elements: restriction (simpleContent), or extension (simpleContent).


The simpleContent element enables you to specify an element as containing a simpleType with no elements but enables you to restrict the value of the element's content or extend the element with attributes. For example, the following element declaration does not allow for adding attributes (such as sizing).

<xs:element name="shoeSize" type="xs:decimal"/>


Using the simpleContent element, the following element declaration contains a complexType element that defines the content of the element as a decimal type with a single attribute (sizing).

<xs:element name="shoeSize">
      <xs:extension base="xs:decimal">
        <xs:attribute name="sizing">
          <xs:restriction base="xs:string">
            <xs:enumeration value="US"/>
            <xs:enumeration value="European"/>
            <xs:enumeration value="UK"/>
            <xs:enumeration value="Japan"/>


Simple content must be defined in one of the following ways.


restriction element

Restricts the range of values for the element to a subset of those for inherited simpleType.

extension element

Extends the simpleType content of the element by adding attributes.


The following example shows an element (generalPrice) declared using an anonymous complexType (one without a name) with its content defined as a decimal data type and with a currency attribute.

<xs:element name="generalPrice">
      <xs:extension base="xs:decimal">
        <xs:attribute name="currency" type="xs:string" />

Other Resources

For more information see the W3C XML Schema Part 1: Structures Recommendation at www.w3.org/TR/2001/REC-xmlschema-1-20010502/#element-all.

See Also

Build Date: