[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Six Reasons Not to use XML Attributes

  • From: "Cox, Bruce" <Bruce.Cox@USPTO.GOV>
  • To: Len Bullard <Len.Bullard@ses-i.com>, "Christopher R. Maden"<crism@m...>, "xml-dev@l..." <xml-dev@l...>
  • Date: Mon, 5 Mar 2012 17:55:13 -0500

RE:  Six Reasons Not to use XML Attributes
Some years ago we learned that different XML-able or -aware systems treated attributes very differently.  In one case, a useful and powerful search engine, it completely ignored them.  Consequently, we've agreed internationally that content should never appear in an attribute, only in an element.  We use attributes for meta data, defined as data that the business doesn't care about, possibly doesn't even know about.  One experienced developer put it this way: if the system won't work without the information, do not put it in an attribute.  We are rarely that extreme in practice, but it's not a bad starting point.

Bruce B Cox
OCIO/AED/Software Architecture and Engineering Division
571-272-9004


-----Original Message-----
From: Len Bullard [mailto:Len.Bullard@ses-i.com] 
Sent: 2012 March 2, Friday 13:04
To: Christopher R. Maden; xml-dev@lists.xml.org
Subject: RE:  Six Reasons Not to use XML Attributes

It's a good theory but in practice (to paraphrase, "theory is what we know but can't use; practice is what we do but can't prove"), attributes are used for displayable content, a simple example being the TM numbers in the mil-spec doc headers.

pubno="DTM 1-1520-280-13"

Which goes to the point there are so far no rules for using these for which there are no exceptions.  Therefore as Mike said, no right answers although as added, some good reasons.

The problems I hit are seldom using these or not but the secret decoder ring knowledge someone needs to apply them correctly in situations where the DTD does not actually govern the final output (say XSLT
contributions) or they are badly documented (say almost any DTD of some size and age).

len


From: Christopher R. Maden [mailto:crism@maden.org] 

There is still a presumption in XML default processing (e.g., the XSLT default templates) that content is visible and attributes are not.  When working with machine interchange languages, this doesn't matter, but for human documents, it is a good principle to follow.

~Chris
--
Chris Maden, text nerd  <URL: http://crism.maden.org/ > "Be wary of great leaders.  Hope that there are many, many small  leaders." - Pete Seeger



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.