473,407 Members | 2,326 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

optional random elements in xml schema

7
Is there a way to specify in a xsd schema that i want to allow some optional subtags in any random order(each occuring at most once), and at least one of them(no matter which) to be present?
Example(this should be validated by the xsd schema)

<parent>
<child1/>
<child2/>
</parent>

<parent>
<child2/>
<child1/>
</parent>

<parent>
<child2/>
</parent>
Jul 16 '07 #1
1 2314
jkmyoung
2,057 Expert 2GB
Expand|Select|Wrap|Line Numbers
  1. <xs:element name="parent">
  2.     <xs:complexType>
  3.         <xs:choice maxOccurs="unbounded">
  4.             <xs:element name="child1"/>
  5.             <xs:element name="child2"/>
  6.         </xs:choice>
  7.     </xs:complexType>
  8. </xs:element>
Jul 16 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: C. M. Sperberg-McQueen | last post by:
wooks (wookiz@hotmail.com) wrote: > <?xml version='1.0'?> > <userlogin xmlns="urn:faster:userlogin" > xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'> > <login>mick</login> > ...
1
by: Wolfgang Lipp | last post by:
my question is: do we need container elements for repeating elements in data-centric xml documents? or is it for some reason very advisable to introduce containers in xml documents even where not...
0
by: Wolfgang Lipp | last post by:
From: Lipp, Wolfgang Sent: Tuesday, 27?January?2004 13:26 <annotation> the first eleven contributions in this thread started as an off-list email discussion; i have posted them here with...
0
by: CJJ | last post by:
Hi, I have an xml schema that defines a number of complex structures where the elements are in sequence, though not all elements are required. <ComplexXmlSchema> <Node A>value</Node A> <Node...
1
by: Gazza | last post by:
I want to define an element type which has child elements which will have an attribute, but I want the presence of content for these child elements (which will be simple when present) to be...
3
by: LJ | last post by:
I am trying to define two xml attribute in my xsd so that they are mutual exclusive and one of them is required. For example, if I have two attributes, they are either <xsd:attribute name="p"...
1
by: Le Tubs | last post by:
Hi I am wondering if anybody has come accross this problem before, basically I have to validate a xml schema (not the data, this is done at a later stage). The only problem is that there are...
1
by: Tookelso | last post by:
Hello, I would like to have a group of elements which are *required* in one context, but each one is *optional* in another context. For example: I have a configuration file which has a...
1
by: Aray | last post by:
There were some different type elements. each of the type has arbitary amount of Elements, and all those Elements is in ramdon order, How Can I write the Schema file?
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.