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

For this assignment, you will develop the back end of a calculator application. The GUI (graphical user interface) has been provided by your instructor. The application will requir


Project Description: I want to build a camera application for android. By default android will add metadata for the image, for e.g.  Date, time, resolution, gps tag etc..In this

Explain the Member Access Separator ? class Car { String licensePlate; // e.g. "New York 543 A23" double speed; // in kilometers per hour double maxSpeed; // in

Project Description: I need a new payment gateway of my own. I mean new payment gateway not any integration. So please bid only if you had made a payment gateway former like

1) Categorical variable tread Pattern = {A, B} and numerical variable tread Depth are used to classify Handling = {good, poor} of a vehicle. Depth is normally distributed with mean

A portal is a service or a Web site that gives broad range of services and resources like e-mail, forums, search engines, weather information, news, on-line shopping, stock quotes.

Excel File to Responsive CSS/HTML page Project Description: Excel file to be converted into a responsive form for a site. In the excel file you will see where the input field