Altova Mailing List Archives>Archive Index >microsoft.public.xml Archive Home >Recent entries >Thread Prev - Re: XSD Restriction >Thread Next - Re: XSD Restriction Re: XSD RestrictionTo: NULL Date: 8/2/2007 12:01:00 AM
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:CCID" 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"xs:string" />
<xs:element name=3D"CCID" type=3D"kuzucommon: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"xs:string" />
<xs:element name=3D"Email" type=3D"kuzucommon: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"xs:string" />
<xs:element name=3D"CCID" type=3D"kuzucommon: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"xs:string" />
<xs:element name=3D"Email" type=3D"kuzucommon: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>
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
