John D. Lewis wrote:
> I would like to ask for opinions on a particular element of style in XML.
>
> I am developing a DTD for a bibliographic database and have several fields
> like Publisher, Frequency, Price, etc. Most of these fields can be
> displayed in two different ways:
>
> 1. Empty tag; e.g. <PUBLISHER NAME=XYZ />
> or
> 2. Tag with content; e.g. <PUBLISHER>XYZ</PUBLISHER>
One disadvantage of using an attribute to store the name of
the publisher is that you have greater difficulty enriching
the encoding so as to indicate what language the string
'XYZ' is written in (and in some contexts, you might want
an indication of its script).
Though other considerations are important, I would personally
recommend not putting "primary" bibliographic data into an
attribute value if there's a realistic chance that you -- or
someone who comes after you -- may want to do language-sensitive
processing on the string data. Of course, XML supports the
notion of an 'xml:lang' attribute that governs the content of
and element and the values of all the other attributes in the
start-tag, but this will break in many/most "multilingual"
contexts. If you have done much bibliographic work, you know
that several languages may be represented in a single
bibliographic record (name of author, editor; title, subtitle,
quoted-title, city name, etc. etc.).
Through the late 1990's, most people have been content to encode
information using markup without regard for the language used
in (sub-)strings. If you have a serious project underway, I
would advise that you reckon with language in the DTD design.
See the document recently posted:
http://www.sil.org/sgml/elementsAndAttrs.html
"When Should I Use Elements, and When Should I Use Attributes?"
Best wishes,
Robin
-------------------------------------------------------------------------
Robin Cover Email: [log in to unmask]
6634 Sarah Drive
Dallas, TX 75236 USA >>> The SGML/XML Web Page <<<
Tel: +1 (972) 296-1783 (h) http://www.sil.org/sgml/sgml.html
Tel: +1 (972) 708-7346 (w)
FAX: +1 (972) 708-7380
========================================================================