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

Re: When you create a markup language, what do yourparent elem

  • From: John Cowan <cowan@mercury.ccil.org>
  • To: David Carlisle <davidc@nag.co.uk>
  • Date: Tue, 27 Sep 2011 16:44:41 -0400

Re:  When you create a markup language
David Carlisle scripsit:

> On 26/09/2011 14:18, Costello, Roger L. wrote:
>> Would you state the meanings of each of those please?
> I don't think there is any particular meaning attached to the fact
> that one element is a child of another. It's just an essentially
> arbitrary syntax choice. In some cases they could have been attributes
> instead of elements, in some cases they could not, but that is only
> because attributes can not contain structure whereas elements can, so
> the choice to use a child element is driven by xml syntax rules rather
> than any properties of the thing that is being modelled in the XML.

What's more, it's often useful to allow syntactic childhood to
represent more than one relationship.  An example from $EMPLOYER's XML
representation of entities (as opposed to documents):

We model organizations as falling into one of four subclasses:
for-profit corporations, non-profit corporations, governmental units,
and informal groups like partnerships and households.  A government
organization may be a legislature or a court or something else.  Each of
these classes has specific properties.

If you query the system asking for information on organizations,
you get a stream of Organization elements (in a top-level wrapper).
Each will have a child element, one of ForProfitCorporation,
NotForProfitCorporation, etc. that will contain all the properties
specific to that type.  The Organization elements will also have
children representing the properties common to all organizations.

Suppose, however, that you query for information on *government*
organizations specifically.  Rather than just returning the same thing,
but restricted to those Organizations with GovernmentOrganization
children, we instead partially invert the structure.  You receive a
stream of GovernmentOrganizations, each of which has an Organization
child representing (as before) the shared properties, *and* a
Legislature or Court or whatever child representing the properties
specific to that sub-subclass.  So syntactic childhood represents in
this case a superclass, a subclass, and one or more properties.

Likewise a request for information on legislatures will return a stream
of Legislature elements with GovernmentOrganization children, each of
which will have Organization children.  The properties will be plugged
in as children of the appropriate class element.

John Cowan      http://www.ccil.org/~cowan      cowan@ccil.org
Be yourself.  Especially do not feign a working knowledge of RDF where
no such knowledge exists.  Neither be cynical about RELAX NG; for in
the face of all aridity and disenchantment in the world of markup,
James Clark is as perennial as the grass.  --DeXiderata, Sean McGrath

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


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.
First Name
Last Name
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.