Re: When you create a markup language, what do yourparent elem
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 firstname.lastname@example.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]
PURCHASE STYLUS STUDIO ONLINE TODAY!
Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!
Download The World's Best XML IDE!
Accelerate XML development with our award-winning XML IDE - Download a free trial today!
Subscribe in XML format