[Home] [By Thread] [By Date] [Recent Entries]

  • From: ht@c... (Henry S. Thompson)
  • To: charlescook@u...
  • Date: Fri, 20 Apr 2001 18:35:58 +0100

charlescook@u... 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@c...
		     URL: http://www.ltg.ed.ac.uk/~ht/

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member