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

Re: [Summary] Constrain the Number of Occurrences of Elements in


Re: [Summary] Constrain the Number of Occurrences of Elements in
The root problem is using grammars in the first place. Moving from FSM
to derivitatives is nice, but the validation-by-parsing model is just a
bad fit for XML. It made sense in SGML, where you needed a grammar to
parse symbols such as short-refs, but it is a carbuncle on XML.
It needs to be replaced by a path based system that allows random access
validation, where types can be statically replaced by paths.

It makes little sense to me that one system (grammars) is required to
validate and assign type, then another (paths) to transform. It is
double handling, inefficient and complex for humans.

So I think a much better approach than either smarter FSM or
derivatives would be to compile grammars into path-based rule
implementations (whether this is XPaths or something with better formal
termination characteristics and easier logic or optimisability
is a different matter). Why require a validation stage when Bookstore/Book
is enough to identify an element with a particular type?

> Issue
>
>
> Should unbounded occurrences be permitted in an XML Schema?

I think "Should" needs to be clarified: is it "should" because
of pragmatic reasons (performance, algorithms, etc) or because
of theoretical reasons (which layer?: "data model", "security",
"tuning", "application",etc.)

And I would rephrase the question as "Should large bounded
occurrences be permitted in an XML Schema"?  Mere unboundedness
doesn't seem to have problems.

It seems that medium to large bounded occurrences (perhaps as
low as a hundred?) should be avoided whereever possible, except
for schemas intended for particular implementations which are
known to use or be safe with large bounded occurrences (e.g.
for some application generator.)

Schematron is practical for filling in many of the gaps between
capabilities of tools/schemas and theoretical layers.

Cheers
Rick Jelliffe

P.S. The annotation containing the assertions should belong
to the Bookstore element declaration not the local Book element
declaration.

 <schematron:assert test="count(Book) <= 30000"/>


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.