Embedding Content as Element Content or As An Attribute Value

Peter Murray-Rust peter at ursus.demon.co.uk
Mon Jan 12 20:48:29 GMT 1998


At 07:00 12/01/98 -0500, [many people] wrote:
[... extended discussion of the attribute vs. content saga... a frequent
theme on *ML discussion groups :-)]

My reading of the three X*L specs is that - on the whole - there is no
syntactic reasons why one approach should be followed rather than another.
I approve of this. However there appear to be the following cases where the
X*L *syntax* favours developers who use one method rather than another.

In XML the attributes xml:lang and xml:space are *inherited*. The intention
is that all DESCENDANTs of ELEMENTs with such attributes behave as if those
attributes were present with the same name and value.  The spec is
deliciously Delphic on the *mechanism* of inheritance. However, since the
same approach is required for XLL implementers to follow, there is (IMO)
considerable pressure for *application* authors (not parser authors) to
develop an inheritance tool. Once developed, this tool is then available
for other attributes not hardcoded into the spec.  Personally I would very
much favour guidance from the WG as to how they see such inheritance being
implemented, as it could perhaps unintentionally lead to somewhat different
semantics.  My current assumption is that the attributes are not cloned
into the DESCENDANTs, but that each descendant may have to be smart enough
to ask its grandma whether she has got any exciting attributes. This may be
non-trivial, especially where documents are being cut-and-pasted...
[Personally I hate things I can't see - and have said so :-)].

The other main area is that XLL-TEI defines substring analysis of mixed
content but NOT attribute values. Thus if you know you may want to search
for a substring in a document it may be valuable to use a mechanism that
casts it into content rather than attributValue. Example:

<FOO BAR="bookshop">XML books</FOO>

allows one to search for 'book' in "XML books" but not in "bookshop". [For
newcomers, you can search for an attribute with the value "bookshop", and
all searches are case-sensitive.]

The XSL spec seems to be very powerful for both content and attributes, and
I think both are well catered for. [Of course it also defeines a certain
number of hardcodable attributes such as ID, CLASS, etc.] Remember that XLL
and XML are still fluidish.

If I have missed anything else in the specs I'd be grateful...

	P.

Peter Murray-Rust, Director Virtual School of Molecular Sciences, domestic
net connection
VSMS http://www.nottingham.ac.uk/vsms, Virtual Hyperglossary
http://www.venus.co.uk/vhg

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