Mega Code Archive

 
Categories / XML Tutorial / XML Schema
 

Defining Elements to Contain Only Text

File: Schema.xsd <?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="popType">     <xsd:simpleContent>       <xsd:extension base="xsd:integer">         <xsd:attribute name="year" type="xsd:integer" />       </xsd:extension>     </xsd:simpleContent>   </xsd:complexType>   <xsd:element name="population" type="popType" /> </xsd:schema>   File: Data.xml   <population xmlns="http://www.rntsoft.com" year="1999">445</population>