[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: [Summary] Constrain the Number of Occurrences of Elementsi


schema engine
hi Roger,

i'm somewhat astonished : if i need to express that the number of books 
mustn't exceed 30000, then i will really use <element name="Book" 
maxOccurs="30000"> because W3C Schema specification allow it ; if the 
schema engine is inefficient to process it without causing out-of-memory 
errors, then i will change the engine or report a bug

Roger L. Costello wrote:
> 
> There is a technical problem with setting maxOccurs="30000". Michael Kay 
> nicely summarizes the problem: "the classical algorithms for turning 
> grammars into finite state machines produce very inefficient machines 
> when there are occurrence limits that are large but finite. Many schema 
> processors break or consume seriously large amounts of memory if you 
> specify a maxOccurs value (other than unbounded) that's greater than a 
> couple of hundred." In other words, a Schema validator will choke if you 
> specify maxOccurs="30000".
> 

i have another conclusion : if this algorithm is inefficient with large 
values, why not switch to a more suitable one for small values ?

what is the challenge ? to implement classical algorithms that apply 
theory of computation, or to make relyable softwares ?
be pragmatic !

> 
> <element name="Bookstore">
>     <complexType>
>         <sequence>
>             <element name="Book" type="..." *maxOccurs="unbounded"*>
>                 *<schematron:assert test="count(Book) <= 30000"/>*
>             </element>
>         </sequence>
>     </complexType>
> </element>
> 
> Comments?
> 

using Schematron to express assertions that W3C Schema can't is 
certainly a good thing ; using Schematron as a hack to correct 
inefficiency of a schema engine is a non-sense (except if you bought one 
that you must use etc)

-- 
Cordialement,

            ///
           (. .)
  -----ooO--(_)--Ooo-----
|   Philippe Poulard    |
  -----------------------

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.