Re: Reason for sequence in XSD's

2007-01-14 Thread Rakesh Midha

David, you are right about only web app j2ee xsd using choice, and some
parts of j2ee application xsd.

As Aaron, said there are number of users reporting error which turned out to
be sequence error. Infact I myself have struggled some time because I tend
to forgot that order has to be maintained. Using choice in place of sequence
help you specially when you copy paste some elements.

Jason, about "a case where it would be necessary to change the order of the
elements", there is no such requirement or case where it is necessary but I
consider sequence as an extra unrequired restrictions and people definatly
don't like redundent thinks and specially "redundent restrictions"

Thanks
Rakesh




On 1/15/07, Aaron Mulder <[EMAIL PROTECTED]> wrote:


We have seen a number of errors on the user list that turned out to be
plans with elements in the wrong order.  I'd have preferred if there
wasn't a specific order I think, but I don't feel strongly enough to
want to change all the schemas.

Thanks,
  Aaron

On 1/14/07, Jason Warner <[EMAIL PROTECTED]> wrote:
>
>
> >
> > >>
> > >> Anyone got an idea, why it is so? I hope I am not missing something
> > >> important here.
> >
> > >I think it was mostly my preference plus a vague attempt to imitate
> > >the spec schemas.  It's definitely not written in stone :-)  Maybe we
> > >should see what other people like.
>
>  I think it is generally easier to pick up and learn and if there is a
set
> order to the elements.  Also, I think it makes it easier to go from one
> document to another if you know where to look in the document for the
> specific element you might be looking for.  Is there a specific reason
to
> not have a set order?  I'm having trouble imagining a case where it
would be
> necessary to change the order of the elements.
>
>



Re: Reason for sequence in XSD's

2007-01-14 Thread Aaron Mulder

We have seen a number of errors on the user list that turned out to be
plans with elements in the wrong order.  I'd have preferred if there
wasn't a specific order I think, but I don't feel strongly enough to
want to change all the schemas.

Thanks,
 Aaron

On 1/14/07, Jason Warner <[EMAIL PROTECTED]> wrote:



>
> >>
> >> Anyone got an idea, why it is so? I hope I am not missing something
> >> important here.
>
> >I think it was mostly my preference plus a vague attempt to imitate
> >the spec schemas.  It's definitely not written in stone :-)  Maybe we
> >should see what other people like.

 I think it is generally easier to pick up and learn and if there is a set
order to the elements.  Also, I think it makes it easier to go from one
document to another if you know where to look in the document for the
specific element you might be looking for.  Is there a specific reason to
not have a set order?  I'm having trouble imagining a case where it would be
necessary to change the order of the elements.




Re: Reason for sequence in XSD's

2007-01-14 Thread Jason Warner


>>
>> Anyone got an idea, why it is so? I hope I am not missing something
>> important here.

>I think it was mostly my preference plus a vague attempt to imitate
>the spec schemas.  It's definitely not written in stone :-)  Maybe we
>should see what other people like.




I think it is generally easier to pick up and learn and if there is a set
order to the elements.  Also, I think it makes it easier to go from one
document to another if you know where to look in the document for the
specific element you might be looking for.  Is there a specific reason to
not have a set order?  I'm having trouble imagining a case where it would be
necessary to change the order of the elements.


Re: Reason for sequence in XSD's

2007-01-12 Thread David Jencks


On Jan 12, 2007, at 6:47 AM, Rakesh Midha wrote:


Hello

I was just wondering if there is any specific reason for using  
"sequence" elements in all our XSD schema's instead of "choice"  
elements.


In most of the mapped J2EE schema's choice is used. Because we are  
using sequence the order of elements is fixed, and if child  
elements are not in order we get invalid element exception all the  
time.


I could be wrong, but I thought I was usually copying the j2ee  
schemas usage.  My impression was that only the web schema used  
choice.  I didn't do a careful analysis :-)


If choice is used instead of sequence, we can definatly avoid those  
exceptions.


I liked sequence because you can tell if a particular kind of element  
is present by looking in only one place rather than having to look  
through the entire container element.


Anyone got an idea, why it is so? I hope I am not missing something  
important here.


I think it was mostly my preference plus a vague attempt to imitate  
the spec schemas.  It's definitely not written in stone :-)  Maybe we  
should see what other people like.


thanks
david jencks



Thanks
Rakesh