[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: XML Schema Question
- From: ht@cogsci.ed.ac.uk (Henry S. Thompson)
- To: charlescook@ukonline.co.uk
- Date: Fri, 20 Apr 2001 18:35:58 +0100
charlescook@ukonline.co.uk writes:
> I've unsucessfuly been trying to represent the
> following element in XML Schema. I suspect its
> not possible. Any suggestions?
>
> The element "value" can contain an element
> called "string" which contains some text:
>
> <value>
> <string>some text</string>
> </value>
>
> or "value" can simply contain some text:
>
> <value>some text</value>
You can define a type for this element, but it won't be as tight as
you'd like:
<xs:element name="value">
<xs:complexType mixed="true">
<xs:sequence>
<xs:element name="string" type="xs:normalizedString" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
</xs:element>
ht
--
Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh
W3C Fellow 1999--2001, part-time member of W3C Team
2 Buccleuch Place, Edinburgh EH8 9LW, SCOTLAND -- (44) 131 650-4440
Fax: (44) 131 650-4587, e-mail: ht@cogsci.ed.ac.uk
URL: http://www.ltg.ed.ac.uk/~ht/