Which is better to store data as attributes or as elements? , JAVA Programming

 

A question rising in the mind of XML/DTD designers is whether to model and encode retain information using an attribute, or alternatively, using an element.

1. Using  an  element:  Lord  of  the  Ring...:  If  you  consider  the  information  in question to be part of the essential material that is being communicated or expressed in the XML, put it in an element

2. Using an attribute: : If you consider the information to be incidental or peripheral  to  the  main  interaction,  or  purely  intended  to  help  applications  process  the  main interaction, use attributes.

The principle is data goes in components and metadata goes in attributes.  Elements are also useful when they occupy special characters like "<", ">", etc which are harder to accept in attributes. The most important reason to use component is its extensibility. It is far simpler to build child elements to reflect complex content than to split an attribute into pieces. You may use attributes along with components to refine your understanding of that element with extra information.

 

Posted Date: 7/27/2012 4:46:39 AM | Location : United States







Related Discussions:- Which is better to store data as attributes or as elements? , Assignment Help, Ask Question on Which is better to store data as attributes or as elements? , Get Answer, Expert's Help, Which is better to store data as attributes or as elements? Discussions

Write discussion on Which is better to store data as attributes or as elements?
Your posts are moderated
Related Questions
Explain The Methods of java.lang.Object? java.lang.Object gives a number of methods that are general to all objects. toString() is the most general such method. Because the def

O/R mapping is well suited for read, change, write centric applications and not suited for write centric applications where data is seldom read. Although this was usually true of m

I need to Make clone of an Android app Project Description: Make a total duplicate of the App: Camp and RV Campgrounds Plus The only difference will be the name (as it

Explain try and catch exception in java? Why use exceptions instead of return values? 1. Forces error checking 2. Cleans up your code through separating the normal case from

Online music store that stores information about song, artist, album, customer, playlist. Also all necessary diagrams - use case, uml, erd

Having trouble with a lab, need to

QUESTION 3: Overloaded methods Write the overloaded method named average () for each of the following problems: a) The first method receives THREE (3) integer values and returns

A target is the class that is being advised. The class can be a third party class or your own class to which you require to add your own custom behavior. By using the concepts of A


The ' is a ' relationship is used with inheritance and ' has a ' relationship is used with composition . Both composition and inheritance allow you to perform sub-objects in