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

Re: Grove diagram (was Re: The Power of Groves)

  • From: "W. Eliot Kimber" <eliot@i...>
  • To: Peter Murray-Rust <peter@u...>
  • Date: Thu, 10 Feb 2000 13:08:08 -0600

rust diagram
Peter Murray-Rust wrote:

> >SGML, not XML, not that that matters much.  The picture is here:
> >
> >  http://www.ltg.ed.ac.uk/~ht/grove.html
> 
> Thanks Henry - I had just managed to find it (on XML-DEV). You beat me to it.
> 
> Would it be simpler in XML? Since - presumably - XML can have a simpler
> property set maybe there would be fewer components in the diagram?

I don't really see how. The picture Henry produced shows the *minimum*
properties of interest, which appear to be identical for XML.

If you look at the DOM, for example, it simplifies by collapsing some
properties that are managed as node lists in the grove into simple
strings (attribute values and PCDATA content), but that useful
simplification doesn't change the reality that a complete abstract
representation has to do provide the individual nodes. Note also that
the groves have a built-in "data" property for nodes that gives the
effect of the DOM's string-only shortcut.

For example, in the SGML/XML grove, a tokenized attribute value (one
declares as IDREFS, for example) is represented as a node list of token
nodes. This exactly reflects the syntax and semantics of attribute
values but is not very convenient when all you want is the full
attribute value string. However, if you ask for the "data" property of
the attribute node, you will get the string value, which is just what
you want.  In Python this looks like this:

# Variable elem is an element node:

atts = elem.AttSpecs  # Get the attributes specified for this element
for att in atts:
  attval = att.data()  # Get the value of the data property of the
attribute specification node
  print "value='%s'" % attval

Using normal DPH techniques, I'd probably get tokens back by using
split():

  if att.Name == "refids":
      ids = string.split(attval)
      for id in ids:
         print "id='%s'" % id

But, if I want to *address* a particular token, the token nodes are
there and I can address them reliably.

In a DOM context you'd probably say "but nobody will ever need to do
that". Probably right, so in the *implementation*, don't bother to
expose that complexity. But a standard data model like the SGML property
set can't presume to know the full requirements of potential users, so
it has to be more complete (and therefore complex) than a purely
pragmatic specification would need or want to be.

It's important to remember that XML simplified SGML *syntax*. It did not
(and could not) simplify the underlying abstract data model (except
where the SGML data model reflects optional features, like attributes
for notations).

This is why the idea that XML is *fundamentally* simpler that SGML is a
Big Lie. The cost of entry is lower, but the total cost of ownership is
essentially the same.

Cheers,

E.

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.