[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Best practices for default values for attributes?
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! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|