W3C home > Mailing lists > Public > xmlschema-dev@w3.org > October 2002

Re: is this a mixed content?

From: Jeni Tennison <jeni@jenitennison.com>
Date: Sun, 13 Oct 2002 09:41:48 +0100
Message-ID: <133258106637.20021013094148@jenitennison.com>
To: xmlschema-dev@w3.org, "Wise, Bowden (Research)" <wisegb@crd.ge.com>

Hi Bowden,

> How do I define a complexType for this kind of element
>
> <NOTE><PART_FIG_ITEM_REF>71_00_03_01_050</PART_FIG_ITEM_REF>APPLY
> MOLYBDENUM DISULPHIDE TO ALL THREADED FASTENERS BEFORE INSTALLATION.
> </NOTE>
>
> Note that NOTE contains an element PART_FIG_ITEM_REF followed by a
> text node
> is that mixed content?

Yes, that is mixed content (a mix of text and element(s)). To define a
complex type for the NOTE element, you should use whatever you'd use
if it *wasn't* allowed to hold text:

<xs:complexType name="NOTEType">
  <xs:sequence>
    <xs:element name="PART_FIG_ITEM_REF" type="xs:token" />
  </xs:sequence>
</xs:complexType>

and then add a mixed="true" to the <xs:complexType> element:

<xs:complexType name="NOTEType" mixed="true">
  <xs:sequence>
    <xs:element name="PART_FIG_ITEM_REF" type="xs:token" />
  </xs:sequence>
</xs:complexType>

Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/
Received on Sunday, 13 October 2002 04:41:57 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:14:34 GMT