[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: attribute vs value


Subject: Re: attribute vs value
From: "John E. Simpson" <simpson@xxxxxxxxxxx>
Date: Fri, 21 May 1999 17:17:26 -0400

At 01:49 PM 05/21/1999 -0700, Cote, Stephane wrote:
>I was wondering if any one knows when to use an attribute
>versus a value in a XML document.

This verges on being the highest-scoring XML FAQ. :)

My rule of thumb is that true content belongs in elements (what you call "values"), and that attributes are for somehow shading the "meaning" of the content in ways that probably aren't useful to be displayed. If you know HTML, you know that attribute values are almost never displayed (except for fringe things like the <img> tag's alt attribute); they're effectively "invisible."

Check Robin Cover's SGML/XML site for good coverage of the question, at:
http://www.oasis-open.org/cover/elementsAndAttrs.html
-- in particular, Eliot Kimber's discussion at:
http://www.oasis-open.org/cover/attrKimber9711.htm



==========================================================
John E. Simpson | The secret of eternal youth
simpson@xxxxxxxxxxx | is arrested development.
http://www.flixml.org | -- Alice Roosevelt Longworth

XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list


Current Thread
Keywords
xml