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

Re: Are we losing out because of grammars?

  • From: Rick Jelliffe <ricko@a...>
  • To: xml-dev@l...
  • Date: Thu, 01 Feb 2001 22:08:31 +0800

Re: Are we losing out  because of grammars?
From: James Clark <jjc@j...>

> If I'm in an "x" element and I get a "y" element with a "z" attribute
> that is a legal lexical representation of an integer, I can't tell
> whether to type that attribute as an "xsd:integer" or an "xsd:string"
> unless I lookahead and see whether it's the last element "y" element in
> the "x".   The TREX implementation works on a stream of SAX events, so
> this is a big complication.

So can we say that in TREX that a type is a path through the grammar?

> It depends how you restrict the grammar.  If you restrict the grammar as
> much as W3C's schemas, type assignment is significantly simpler than
> validation (since I believe I am correct in saying that for W3C schemas
> the type of an element depends only on its name and the names of its
> parents).

For XML Schemas, it depends on what you call type. "Nullability" (or
whatever it is called, gawd don't get me started) is spoken as a "property"
of elements not of "types".  And xsi:type can override the type to a
compatible one.

> There are many
> applications for which type-assignment is not necessary; I think
> dispatching on the "FQGI" (ie on the name of the element and the names
> of its ancestor elements) is sufficient for many applications.

I think there are three issues: one is how specifically we can identify
element or attributes in context, the second is what abstractions we use to
express them, the third is what side-effects the abstractions have.  For
example, DTDs have just parent, sibling, group identification; these are
encoded using the grammar abstraction; the grammar abstraction forces us to
decide issues of order, belonging and parent-to-child occurrence even when
they are not relevant.

I wonder, given the existence, deployment and suitablility of James' XPath,
why we need to settle for "sufficient for many applications".  Smart readers
of XML-DEV will of course say "oh, but probably you can express things in
content models that you cannot express in paths and rules" but I have my
doubts: a really complex content model is IMHO often (always) either the
sign of struggling against the grammar or a kind of tag ommission: if there
is some complex structure there, why isn't it explicitly labelled for all
the world to see?

Cheers
Rick Jelliffe


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.