Embedding Content as Element Content or As An Attribute Value

Paul Prescod papresco at technologist.com
Mon Jan 12 20:50:45 GMT 1998


Michael Kay wrote:
> Paul Prescod wrote, inter alia:
> >I'm surprised, though that you would claim that the distinction between
> >"hasproperty" and "containsobject" is missing in every ontological
> >system you are aware of.
> 
> That distinction is certainly one of the traditional difficulties of all
> data modelling, and thanks, yes, it's helpful to see it in those terms.
> But I don't think the XML/SGML distinction between attributes and
> content is quite the same. If we consider the difference between:
> 
> <PIZZA PRICE="$12.00" DESC="Ham and mushroom"/>
> versus
> <PIZZA PRICE="$12.00">Ham and Mushroom</PIZZA>

True enough, SGML does not require you to use its features to model this
(or any) ontological distinction. It does not even encourage you to do
so. My point was just that attributes often allow you to do so, if it
makes sense in your problem domain. Unfortunately the fact that they
cannot have sub-structure often constrains their use in this way.
 
> The alternative seems to be disallow character content entirely,

As David M. pointed out, XML does have the concept of ignorable
whitespace and it was intended to solve precisely this problem.

 Paul Prescod
--
http://itrc.uwaterloo.ca/~papresco

Art is always at peril in universities, where there are so many people, 
young and old, who love art less than argument, and dote upon a text 
that provides the nutritious pemmican on which scholars love to chew. 
				-- Robertson Davies in "The Cunning Man"



xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev at ic.ac.uk
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/
To (un)subscribe, mailto:majordomo at ic.ac.uk the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo at ic.ac.uk the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa at ic.ac.uk)




More information about the Xml-dev mailing list