![]() |
![]() | ![]() | ![]() | Altova Mailing List Archives>Archive Index >microsoft.public.xml Archive Home >Recent entries >Thread Prev - Non-restrictive XSD Enumeration >Thread Next - RE: Non-restrictive XSD Enumeration RE: Non-restrictive XSD EnumerationTo: NULL Date: 11/6/2006 3:49:00 PM If you define <xs:enumeration/> the instance value must match one of the enumerations. You might try using <xs:pattern/> and give a regular expression instead, or just use plain xs:string as type if there is no rule on the value. -- S. Huseyin Ulger [MSFT] MSXML Dev "Eric Lemmon" wrote: > Hello, > > I have an XML file with an XSD schema file behind it, so my users that edit > the XML directly [in VS 2005] receive Intellisense dropdowns for all > enumerations. > > How can I make some of these enumerations flexible enough, so that the doc > won't fail schema validation when text is entered that is not an enumerated > value? > > For example, this would mimic how the maxOccurs attribute has the > "unbounded" enumeration, but it permits you to add an integer value. > > Here is a snippet of the offending XSD: > <xs:element name="PhoneType" maxOccurs="1" minOccurs="0"> > <xs:simpleType> > <xs:restriction base="xs:string"> > <xs:enumeration value="Home" /> > <xs:enumeration value="Office" /> > </xs:restriction> > </xs:simpleType> > </xs:element> > > How can I make both of these pass schema validation? > <PhoneType>Home</PhoneType> > <PhoneType>Cell</PhoneType> > > Thank you, > > Eric > | ![]() | ![]() | ![]() |
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | |||||
|
