Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XML
|
XML General XML discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XML section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 28th, 2004, 02:26 PM
Registered User
 
Join Date: Apr 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to guozhang
Default Restrict elements

Hi,

I have a complex type element which can take three possible child elements, of which one is a must and only one of the other two can appear. I am not sure how to apply the restriction.

Specifically, the fundSrc_ID element must appear but either org_id or OtherGranteeOrg should appear but not both.

How to prevent org_id and OtherGranteeOrg from both appearing?

Any idea/help is appreciated.

John


---------------------------------------------------------
Sample XML Schema element:
Code:
<xs:element name="rec" maxOccurs="unbounded">
                <xs:complexType>
                    <xs:all>
                        <xs:element name="fundSrc_ID" type="FundSrc_ID_Type"/>
                        <xs:element name="org_ID" type="Org_ID_Type" minOccurs="0"/>
                        <xs:element name="OtherGranteeOrg" type="xs:string" minOccurs="0"/>
                    </xs:all>
                    <xs:attribute name="CADR_ID" type="CADRIDType" use="required"/>
                </xs:complexType>
            </xs:element>







Similar Threads
Thread Thread Starter Forum Replies Last Post
How to: Restrict access to paged data jimibt BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 1 April 5th, 2007 05:50 AM
restrict to paste values only jcellens Excel VBA 1 July 18th, 2006 11:36 AM
restrict entry to only one cell in a row sriramus Access VBA 1 March 3rd, 2006 02:14 PM
how to restrict strings with particular characters srini XSLT 6 November 28th, 2003 07:03 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.