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

Re: Best practices for default values for attributes?

  • To: Elliotte Harold <elharo@m...>
  • Subject: Re: Best practices for default values for attributes?
  • From: Michael Good <musicxml@y...>
  • Date: Thu, 10 Mar 2005 13:44:55 -0800 (PST)
  • Cc: xml-dev@l...
  • Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys
  • Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; b=1llecxy7pUoIMrX3soC3o/PC6csUew8PwOgxkpRkRh/NU+mViEFxDaZIvsA5kE9xNjTuy61mG2iShwGi5E/m+uOrOMq+mj/cFCAOidCR55GYjXEeupoeBjOW47tRdKdon2pxCF5xHeqMV6tVgOSvHiaQeaubxTPQpdcfnWjdSLk= ;
  • In-reply-to: 6667

missing values and best practice
Hi Elliotte,

Thanks! I did see that, but that seemed to be more for encoding the MusicXML
document than designing the MusicXML DTD. So you're saying that this principle
should also apply to authoring DTDs - define defaults for missing values in the
spec, but don't use default attributes?

What happens in that case is that you have to write the same type of code with
a validating parser as a non-validating parser. That can make things more
robust across changes in parser technology, DTD version changes, and the like.
But one could argue that it makes the DTD harder to read and use.

I'm leaning towards keeping things as-is and not adding default values, but I'm
interested in the experiences of people using XML for document interchange in
other domains.

Thanks,

Michael Good
Recordare LLC
www.recordare.com

--- Elliotte Harold <elharo@m...> wrote:
 
> You aren't looking in the right chapter. :-) Item 18, "Include all 
> information in instance documents" strongly recommends against using 
> default attribute values. The problem arises when processing documents 
> with tools like browsers that don't read the DTD.
> 
> I wasn't aware of the problem with editors cluttering the display with 
> default attribute values (I mostly use plain text editors myself) but 
> that sounds like another good reason to avoid default attribute values.



		
__________________________________ 
Do you Yahoo!? 
Make Yahoo! your home page 
http://www.yahoo.com/r/hs

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.