[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Embedding Content as Element Content or As An Attribute Value
>Michael Kay wrote: >> the XML community. Philosophically - at least in terms of any >> ontological system I am aware of it is a nonsense.... [Paul Prescod] > >You've missed the point that attributes have an important feature w.r.t >extensibility. An unknown attribute just disappears in processing, since >they are named by role. In every XML/SGML processing system I am aware >of (including XML DTDs, DSSSL, XSL and probably SAX), it is harder to >handle unknown elements because their GI could represent either their >role or their object type. Attributes have a couple of other "attributes" that feature in the list of pragmatics. 1) An attribute is associated with an element type and typically communicated as such by parsers. Thus you do not need to establish a context in processing software. One less piece of state-space. Say element types foo and bar have an attribute "n" and we wish to print out its value for foo elements only. We have this (in pseudo-something) : element foo { print attributes["n"] } Rather than this: element n { if parent == "foo" print GetDataDescdendants() } 2) Attributes can be added without changing the instance. This is a sort of "out of line linking" that allows new layers of meaning to be added to elements perhaps years after the content has been created. Although this approach has its limits, it can be hugely useful as Eliot Kimber et. al. have demonstrated on this list many times. It will be possible, I imagine, to do this sort of on-the-fly layering with sub-elements rather than attributes in, say, XMLData. But the attribute approach just feels right somehow:-) Final comment: I think the most exasperating thing for classically trained data modellers approaching SGML/XML is that a lot of the established terminology of the field pops up meaning completly different things. vis. Entity/Attribute modelling. Argh! Sean Mc Grath sean@d... Digitome Electronic Publishing http://www.digitome.com xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev@i... Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/ To (un)subscribe, mailto:majordomo@i... the following message; (un)subscribe xml-dev To subscribe to the digests, mailto:majordomo@i... the following message; subscribe xml-dev-digest List coordinator, Henry Rzepa (mailto:rzepa@i...)
|
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
|