File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes XML and Related Technologies and the fly likes Using both xs:sequence and xs:all Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Using both xs:sequence and xs:all" Watch "Using both xs:sequence and xs:all" New topic

Using both xs:sequence and xs:all

Luis Machado

Joined: Oct 04, 2010
Posts: 2

I'm making a schema to a file where i have a sequence os elements:

<A> bla </A>
<B> bla </B>
<C> bla </C>
<D> bla </D>
<E> bla </E>
<F> bla </F>

However, i need to have the C, D and E nodes in any order, per example:


How can I maintain a sequence A,B ... F and inside of it something with no order?

I already tried something like:

but with no sucess.

Thanks ;)
Luis Machado

Joined: Oct 04, 2010
Posts: 2
No one?

I was thinking about using the choose tag, and list all the possible combinations, but with 3 elements that would mean 9 combinations.
I dont know if that is the best way to do it...
Jimmy Clark
Ranch Hand

Joined: Apr 16, 2008
Posts: 2187
You might have better luck trying to create an XML DTD with these rules rather than an XML Schema.
Paul Clapham

Joined: Oct 14, 2005
Posts: 19691

When I see a question like this, my thought is "Who invented this requirement and can they be persuaded to change it to something more practical?"
I agree. Here's the link:
subject: Using both xs:sequence and xs:all
It's not a secret anymore!