Altova Mailing List Archives>Archive Index >microsoft.public.xml Archive Home >Recent entries >Thread Prev - Re: XSD restriction to a set of string values >Thread Next - Re: XSD restriction to a set of string values Re: XSD restriction to a set of string valuesTo: NULL Date: 12/5/2008 8:38:00 AM On Dec 4, 7:59=A0am, Martin Honnen <mahotr...@yahoo.de> wrote: > Peter Olcott wrote: > > I need to know the syntax for restricting a type to a > > specific set of string values where these string values are > > not encoded as enumeration types. > > You could use a regular expression pattern e.g. this schema > > <xs:schema > =A0 =A0xmlns:xs=3D"http://www.w3.org/2001/XMLSchema"> > > =A0 =A0<xs:element name=3D"root"> > =A0 =A0 =A0<xs:complexType> > =A0 =A0 =A0 =A0<xs:sequence maxOccurs=3D"unbounded"> > =A0 =A0 =A0 =A0 =A0<xs:element name=3D"foo" type=3D"fooType"/> > =A0 =A0 =A0 =A0</xs:sequence> > =A0 =A0 =A0</xs:complexType> > =A0 =A0</xs:element> > > =A0 =A0<xs:simpleType name=3D"fooType"> > =A0 =A0 =A0<xs:restriction base=3D"xs:string"> > =A0 =A0 =A0 =A0<xs:pattern value=3D"bar|baz"/> > =A0 =A0 =A0</xs:restriction> > =A0 =A0</xs:simpleType> > > </xs:schema> > > allows the values 'bar' and 'baz' for the 'foo' element. > > -- > > =A0 =A0 =A0 =A0 Martin Honnen --- MVP XML > =A0 =A0 =A0 =A0http://JavaScript.FAQTs.com/ I am trying to make a SOAP interface such that the client can dynamically reconfigure its graphical user interface with no programming changes and no recompile required whenever the web service is updated with new capabilities. Because of this your suggestion may not work. It would see that you suggestion would at least require a recompile. What I am trying to do may not be possible with pure SOAP, and may require the SOAP message to have an embedded XML payload. How would this be specified in a SOAP XSD document? | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
