Content roles in XML

Jim Amsden jamsden at us.ibm.com
Thu Jan 22 20:06:30 GMT 1998


I just thought of a simple mechanism for describing the role an element plays
in the content model for an element. What's needed is a way to give names for
content elements (which currently only give the content type). How about
something like roleName=contentElement (e.g., addListenerMethod=Method). This
is similar to how attribute names define the role a value plays in describing a
characteristic of an element. Default roles could be the same as the
contentElement name, the same as in UML. So, this could be a simple upwardly
compatible extension to XML. It's also simpler and more regular than using
parameter entities.

The example could then look like:

<!ELEMENT EventSet (Annotation*,
    addListenerMethod=Method,
    removeListenerMethod=Method,
    Method+)
>
<!ATTLIST EventSet
  %FeatureDescriptor;

  listenerType CDATA #REQUIRED
  isInDefaultEventSet (true | false) "false"
  isUnicast (true | false) "false"
>

Notice that I used the default for all the event methods because that's a
reasonable role name. The DOM could retain the role name for the content and
allow queries based on this name the same way it does for attributes. This
would make the DOM much more semantically rich and would reduce the need to
create a lot of customizable nodes.


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