Attr+: Integrating attributes and elements

Arnold, Curt Curt.Arnold at hyprotech.com
Mon Aug 23 17:51:44 BST 1999


It does have an initial appeal and I do use that type of construct
frequently, but I think it has some problems trying to build it into the
schema language.  If it is done at all, maybe it should really be an
Element-.  One of the key limitations of attributes is the inability to
support structure.  So I'm forced to make a transition to an element when I
need to add structured content, but I can use the attribute form when I
don't have any structured content.  The attribute can represent an element
that in this particular instance has no structured content.

Say, if I have a schema to communicate weather readings that reads something
like:

<reading>
	<location airportCode="IAH" temperature="33"/>
</reading>

If I decided that I needed to add annotation to the temperature, I'd need to
support something like:

<reading>
	<location airportCode="IAH">
		<temperature value="33">
			<note>Readings are delayed by 15 minutes</note>
		</temperature>
	<location>
</reading>

My processing software could be smart enough to support either form.  So if
I didn't have a note to go with the reading I could use the attribute form.

However I'm not sure if I want the schema to have to define the map from the
element form to the attribute form or have the DOM produce a phantom element
for me.


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/ and on CD-ROM/ISBN 981-02-3594-1
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