Re: Attribute Question

Peter Murray-Rust (peter@ursus.demon.co.uk)
Wed, 26 Aug 1998 23:04:24


At 13:15 26/08/98 -0700, Frank Blau wrote:
>If I have 3 attributes ("Format", "Usage", and "Loop") that I want every
>element in my DTD to have, is there a way to globally declare them? Do
>subelements inherit the attributes of the parent element?

As several people have said, no.

But there are signs of similar things in the specs already. The values of
xml:lang and xml:space 'apply' to the children of the containing element
(unless superseded). And xml:link and some other attributes (still in
draft) *are* required to be inherited. This leads to some pressure to
provide 'inheritance-like' software for attributes. It's wasteful and
error-prone if every application has to think about a (probably growing)
set of inheritance-like phenomena and I'd certainly like it to be addressed
in the layered APIs we are starting to discuss.

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