Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > At least one child

Reply
Thread Tools

At least one child

 
 
pawel.pabich@gmail.com
Guest
Posts: n/a
 
      10-04-2005
Hajo,

Example of XML:
<root>
<a/>
<b/>
<c/>
</root>

I need to ensure that one of a/b/c tags is present
and every of them can appear only once and they can
appear in any order.

any idea?

thanks in advance for info

Pawel

 
Reply With Quote
 
 
 
 
pawel.pabich@gmail.com
Guest
Posts: n/a
 
      10-04-2005
One more thing. _at_least_ one of a/b/c tags has to be present.

Pawel

 
Reply With Quote
 
 
 
 
Harrie
Guest
Posts: n/a
 
      10-04-2005
http://www.velocityreviews.com/forums/(E-Mail Removed) said the following on 2005-10-04 12:56 +0200:

> I need to ensure that one of a/b/c tags is present


Are you talking about a Schema (DTD, XSD) or something else?

> and every of them can appear only once and they can
> appear in any order.


If they may only apear once, how can they appear in any order?

--
Regards
Harrie
 
Reply With Quote
 
pawel.pabich@gmail.com
Guest
Posts: n/a
 
      10-04-2005
Hajo,

Soory, I am talking about schema.

Every tag can appear once, it means that following are valid:

<root>
<a/>
<b/>
</root>

<root>
<c/>
<b/>
</root>

but at least one of them has to be present.


Pawel

 
Reply With Quote
 
Henry S. Thompson
Guest
Posts: n/a
 
      10-06-2005
<xs:all>
<xs:element name="a" minOccurs="0"/>
<xs:element name="b" minOccurs="0"/>
<xs:element name="c" minOccurs="0"/>
</xs:all>

will get you most, but not all, of what you want -- W3C XML Schema has
no way to express the "at least one of them must be present"
constraint.

ht
--
Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh
Half-time member of W3C Team
2 Buccleuch Place, Edinburgh EH8 9LW, SCOTLAND -- (44) 131 650-4440
Fax: (44) 131 650-4587, e-mail: (E-Mail Removed)
URL: http://www.ltg.ed.ac.uk/~ht/
[mail really from me _always_ has this .sig -- mail without it is forged spam]
 
Reply With Quote
 
pawel.pabich@gmail.com
Guest
Posts: n/a
 
      10-06-2005
Thanks

Pawel

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Need regular expression for at least 7 characters and at least 1 special chatacter AAaron123 ASP .Net 0 10-03-2008 01:25 PM
Re: Forcing a parent tag to have at least one child via an XML schema Martin Honnen XML 0 10-03-2008 01:02 PM
Re: Forcing a parent tag to have at least one child via an XML schema Mukul Gandhi XML 0 10-03-2008 12:53 PM
EJB: How to delete child entries from a parent-child CMR one-to-many relationship? davout Java 0 04-18-2004 07:02 PM
How do I: Main thread spawn child threads, which child processes...control those child processes? Jeff Rodriguez C Programming 23 12-09-2003 11:06 PM



Advertisments