Mega Code Archive

 
Categories / XML Tutorial / XML Schema
 

Defining Elements with Mixed Content

When creating a complex type that will define such an element, you must declare that the content will be mixed.   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="paragraph" mixed="true">     <xsd:sequence>       <xsd:element name="name" type="xsd:string"/>     </xsd:sequence>     <xsd:attribute name="length" type="xsd:string" />   </xsd:complexType>   <xsd:element name="description" type="paragraph" /> </xsd:schema> File: Data.xml  <description xmlns="http://www.rntsoft.com" length="short">The  <name>tiger</name> world.  </description>