OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

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

[ Lists Home | Date Index | Thread Index ]

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"/>





 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS