Entity References in Attribute Values

The production for Attribute refers to AttValue, which is inconveniently defined elsewhere. But if you look closely, note that you can have entity references in attribute values. In fact, this turns out to be very useful. In the document you are now reading, there are a lot of hyperlinks into the XML spec; these are done with an ordinary href attribute, for example:

<x href='&spec;id(sec-starttags)'>

Then we can use the official copy of the spec at the W3C site, or a local copy on disk, just by changing the definition of the spec attribute. Also it saves a lot of typing and disk space.

Back-link to spec

Copyright © 1998, Tim Bray. All rights reserved.