3
votes

I am reading this tutorial and it states that to get an xml like this:

<letter>
  Dear Mr.<name>John Smith</name>.
  Your order <orderid>1032</orderid>
  will be shipped on <shipdate>2001-07-13</shipdate>.
</letter> 

you need this xml schema definition:

<xs:element name="letter">
  <xs:complexType mixed="true">
    <xs:sequence>
      <xs:element name="name" type="xs:string"/>
      <xs:element name="orderid" type="xs:positiveInteger"/>
      <xs:element name="shipdate" type="xs:date"/>
    </xs:sequence>
  </xs:complexType>
</xs:element> 

But I see that is not completely correct. It defines the name, orderid, and shiptdate elements but it didn't define the plain text like Dear Mr., Your order and will be shipped on

The only xs:string type has been assigned to the name element.

Could you help me understanding that please?

Many thanks

1

1 Answers

5
votes

That's what the mixed="true" does - it permits arbitrary text around and between the declared elements of the complex type. The elements must appear in the required sequence but there can be any text in between.