Mega Code Archive

 
Categories / XML Tutorial / XML Schema
 

Defining Elements to Contain Only Elements

An element with the most basic of complex types can contain other elements, and possibly attributes as well-but not text. The elements contained within a complex type must be part of a sequence, choice, unordered group, or named group.   <?xml version="1.0"?> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"   targetNamespace="http://www.rntsoft.com" xmlns="http://www.rntsoft.com"   elementFormDefault="qualified">   <xsd:complexType name="endspeciesType">     <xsd:sequence>       <xsd:element name="animal" type="xsd:string" />     </xsd:sequence>   </xsd:complexType> </xsd:schema>