Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: XSD Restriction

From: ibrahimover@-----.---
To: 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>




transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent