Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > The usage of <xs:choice maxOccurs="unbounded">

Reply
Thread Tools

The usage of <xs:choice maxOccurs="unbounded">

 
 
mavis
Guest
Posts: n/a
 
      06-01-2006
The usage of <xs:choice maxOccurs="unbounded">

When we want to define a set of elements that could be in any order and
with any occurences (0-unbounded), we can use <xs:choice
maxOccurs="unbounded">

But I alway think that is not a good schema definition for XML files,
and it must influence the writing and reading performance of these set
of elements if there are large amounts of sub-elements. We can imagine
that the retrieval of any single element will need to loop through all
the subelements.......

Any advices of this will be highly appreciated!!

 
Reply With Quote
 
 
 
 
Joe Kesselman
Guest
Posts: n/a
 
      06-01-2006
mavis wrote:
> But I alway think that is not a good schema definition for XML files,
> and it must influence the writing and reading performance of these set
> of elements if there are large amounts of sub-elements.


If there are many sub-elements, it takes more time to read them than if
there are only a few. The use of maxOccurs="unbounded" (or simply not
specifying maxOccurs at all) doesn't change that. If anything, unbounded
might reduce parsing cost because there's no need to maintain a counter
and check whether it has been exceeded.

You're wasting time trying to micro-optimize the wrong things.



--
() ASCII Ribbon Campaign | Joe Kesselman
/\ Stamp out HTML e-mail! | System architexture and kinetic poetry
 
Reply With Quote
 
 
 
 
mavis
Guest
Posts: n/a
 
      06-01-2006
I guess whether it is in order does make difference..


Joe Kesselman wrote:
> mavis wrote:
> > But I alway think that is not a good schema definition for XML files,
> > and it must influence the writing and reading performance of these set
> > of elements if there are large amounts of sub-elements.

>
> If there are many sub-elements, it takes more time to read them than if
> there are only a few. The use of maxOccurs="unbounded" (or simply not
> specifying maxOccurs at all) doesn't change that. If anything, unbounded
> might reduce parsing cost because there's no need to maintain a counter
> and check whether it has been exceeded.
>
> You're wasting time trying to micro-optimize the wrong things.
>
>
>
> --
> () ASCII Ribbon Campaign | Joe Kesselman
> /\ Stamp out HTML e-mail! | System architexture and kinetic poetry


 
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
What is the difference between Memory Usage and Heap Usage in my JVMMetrics ? Krist Java 8 02-10-2010 12:44 AM
retrieving CPU Usage and Memory Usage information in JAVA hvt Java 0 03-13-2007 01:09 PM
retrieving CPU Usage and Memory Usage information in JAVA hvt Java 0 03-13-2007 01:07 PM
Webchecker Usage - a problem with local usage Colin J. Williams Python 1 02-26-2004 12:28 AM
Need help on memory usage VS PF usage metfan Java 2 10-21-2003 01:58 PM



Advertisments