473,404 Members | 2,195 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,404 software developers and data experts.

Mixing ordered and unordered elements

Hi,

I try to write a schema to validate this :

<F>
<L/>
<A/>
<B/>
<C/>
</F>

where
- L has to be present once and only once and at first place
- each of A,B,C have to be present once and only once but
not ordered ( ABC, BAC, CAB, ...)

Thank you for your help

Yann

Aug 19 '05 #1
1 1333
"yann" <yd*****@gmail.com> writes:
Hi,

I try to write a schema to validate this :

<F>
<L/><A/><B/><C/>
</F>

where
- L has to be present once and only once and at first place
- each of A,B,C have to be present once and only once but
not ordered ( ABC, BAC, CAB, ...)


In XML DTD notation, what you are asking for is

(L, ( (A, ((B,C) | (C, B)))
| (B, ((A,C) | (C, A)))
| (C, ((A,B) | (B, A)))))

This has a straightforward translation into any schema language
you might wish to use.

SGML DTDs allow you to write

(L, (A & B & C))

which is shorter and means the same thing.

There are a couple of reasons to think twice before you do this,
however, in addition to the fact that working out all possible
sequences is boring.

First, the content model you describe makes sense only when the
order of A, B, and C conveys significant information. If the
order conveys no information, then you might as well fix it:

(L, A, B, C)

Second, it seems odd that the ordering constraints among
siblings should change in mid-stream. Abstractly, it
looks as if your content model falls into two pieces:
the L, and then the A-B-C sequence. It might make sense
to model that fact directly. In SGML notation:

<!ELEMENT container (L, ABCseq) >
<!ELEMENT ABCseq (A & B & C) >

In this case, the definition of ABCseq can easily be translated
into an XML Schema all-group.

--C. M. Sperberg-McQueen
World Wide Web Consortium
Aug 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Stephen Miller | last post by:
Hi, How can I configure an ordered list so that the bullet is placed on the right hand side of the list item. ie: list item 1 * list item 2 * list item 3 * Thanks,
33
by: Jim Cobban | last post by:
I cannot get Netscape 4.79 to properly display the ordered list in the following fragment. <P>Get a specific portion of the date. Depending upon the value of index: <ol start=0> <li>complete...
210
by: Christoph Zwerschke | last post by:
This is probably a FAQ, but I dare to ask it nevertheless since I haven't found a satisfying answer yet: Why isn't there an "ordered dictionary" class at least in the standard list? Time and again...
41
by: Rene Nyffenegger | last post by:
Hello everyone. I am not fluent in JavaScript, so I might overlook the obvious. But in all other programming languages that I know and that have associative arrays, or hashes, the elements in...
1
by: rllioacvuher | last post by:
I need help with a program. I have implemented that following header file with an unordered list using one array, but i need to be able to use an ordered list and 2 arrays (one for the links and one...
3
by: User | last post by:
Hi, Is it possible to transform Ordered/Unordered list into navigation dropdown menus? Is this effect achieved by CSS? or via Javascript? PLease advise Thanks.
2
by: klikic | last post by:
Hi. How can create a unordered sequence with defined elements that can occur ones and "other" elements that are ignored. Example: XML: <Recur> <ignoredElement>saasda</ignoredElement>...
1
by: shapper | last post by:
Hello, I am creating 3 "elements" to display on a web site: a menu, a form and a pager to a table. In three cases I am using a list where each list item serves as a container of: - the menu...
5
by: ranyeng | last post by:
Suppose I have an Unordered List in my HTML file: <html> <head> <SCRIPT LANGUAGE="JavaScript"> function remove(){ //code to remove the old elements var...
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
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
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.