![]() |
![]() | ![]() | ![]() | Altova Mailing List Archives>Archive Index >microsoft.public.xml Archive Home >Recent entries >Thread Prev - Re: XSD Restriction [Thread Next] Re: XSD RestrictionTo: NULL Date: 8/2/2007 5:49:00 AM
On 2 Aug, 08:01, ibrahimo...@gmail.com wrote:
> Hello
>
> Thanks for your help but i tries xs:choise like below
>
> <xs:element name=3D"UpdateSubscriptionRequest">
> <xs:complexType>
> <xs:all>
> <xs:element name=3D"CampaignID"
> type=3D"xs:string" />
> <xs:choice>
> <xs:element name=3D"CCID" type=3D"XXX:CCI=
D" minOccurs=3D"0"
> maxOccurs=3D"1" />
> <xs:element name=3D"Email"
> type=3D"XXX:EmailType" minOccurs=3D"0" maxOccurs=3D"1" />
> </xs:choice>
>
> </xs:all>
> </xs:complexType>
> </xs:element>
>
> and it didnt worked then i tried like below
>
> <xs:element name=3D"UpdateSubscriptionRequest">
> <xs:complexType>
> <xs:choice>
> <xs:group ref=3D"RequestType1" />
> <xs:group ref=3D"RequestType2" />
> </xs:choice>
> </xs:complexType>
> </xs:element>
>
> <xs:group name=3D"RequestType1">
> <xs:all>
> <xs:element name=3D"CampaignID" type=3D"x=
s:string" />
> <xs:element name=3D"CCID" type=3D"kuzucom=
mon:CCID" minOccurs=3D"0"
> maxOccurs=3D"1" />
> </xs:all>
> </xs:group>
>
> <xs:group name=3D"RequestType2">
> <xs:all>
> <xs:element name=3D"CampaignID" type=3D"x=
s:string" />
> <xs:element name=3D"Email" type=3D"kuzuco=
mmon:EmailType" minOccurs=3D"0"
> maxOccurs=3D"1" />
> </xs:all>
> </xs:group>
>
> and it didnt worked but if i try like below it works but =FD dont want
> to use xs:sequence
>
> <xs:element name=3D"UpdateSubscriptionRequest">
> <xs:complexType>
> <xs:choice>
> <xs:group ref=3D"RequestType1" />
> <xs:group ref=3D"RequestType2" />
> </xs:choice>
> </xs:complexType>
> </xs:element>
>
> <xs:group name=3D"RequestType1">
> <xs:sequence>
> <xs:element name=3D"CampaignID" type=3D"x=
s:string" />
> <xs:element name=3D"CCID" type=3D"kuzucom=
mon:CCID" minOccurs=3D"0"
> maxOccurs=3D"1" />
> </xs:sequence>
> </xs:group>
>
> <xs:group name=3D"RequestType2">
> <xs:sequence>
> <xs:element name=3D"CampaignID" type=3D"x=
s:string" />
> <xs:element name=3D"Email" type=3D"kuzuco=
mmon:EmailType" minOccurs=3D"0"
> maxOccurs=3D"1" />
> </xs:sequence>
> </xs:group>
>
> On 1 A=F0ustos, 18:31, "Joe Fawcett" <joefawc...@newsgroup.nospam>
> wrote:
>
>
>
> > If you can have one or the other don't you need xs:choice?
>
> > --
>
> > Joe Fawcett (MVP - XML)
>
> >http://joe.fawcett.name
>
> > <ibrahimo...@gmail.com> wrote in message
>
> >news:1185978484.257637.232280@o......
> > Hello, im new to XML and XSD and i have some problems on
> > restrictions.
> > i want to use it for updateing subscription so i can update it with D
> > or with Emai
> > so i must have one of them but it doesnt matter which one. i tried
> > below but with that i may not have both email and id
>
> > is there any way to solve this problem?
>
> > <xs:element name=3D"UpdateSubscriptionRequest">
> > <xs:complexType>
> > <xs:all>
> > <xs:element name=3D"CCID" type=3D"XXX:CCID" minOccurs=3D"0"
> > maxOccurs=3D"1" />
> > <xs:element name=3D"Email" type=3D"XXX:EmailType" minOccurs=3D"0"
> > maxOccurs=3D"1" />
> > </xs:all>
> > </xs:complexType>
> > </xs:element>- Hide quoted text -
>
> - Show quoted text -
Hi,
I think the following arrangement may be what you are looking for:
<xs:element name=3D"UpdateSubscriptionRequest">
<xs:complexType>
<xs:sequence>
<xs:element name=3D"CampaignID" type=3D"xs:string" />
<xs:choice>
<xs:element name=3D"CCID" type=3D"XXX:CCID" />
<xs:element name=3D"Email" type=3D"XXX:EmailType" />
</xs:choice>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
In general the restrictions schema places on xs:all mean that it
offers more hope than usefulness!
HTH,
Pete.
--
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
Pete Cordell
Codalogic
for XML Schema to C++ data binding visit
http://www.codalogic.com/lmx/
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
| ![]() | ![]() | ![]() |
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | |||
|
