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
Get info from website using javascript Project Description: I need to extract the text from all the available (red, blue) seats of all the events on this site without getting

JMS consumer is a JMS client that receives messages.

THE FOLLOWING PROGRAM SHOULD BE JAVA IN ECLIPSE Minimal Spanning Tree Decreasing Edge Dismissal Reverse-delete algorithm. Develop an implementation that computes the MST as fol

Describe about the term Access Protection ? Global variables are a typical cause of bugs in most programming languages. A few unknown function can modify the value of a variabl

Write a JavaScript program to prompt the user for the radius of a sphere and call function sphereVolume to calculate and display the volume of the sphere in the status bar.

Application using Swing API

In the lectures, we have written programs for bond pricing in discrete time. We have also talked about the theory for bond pricing and yields in continuous time. In this exercise,


I need the five methods public class Ex1Program { public void start() { // Step 1. Declare and construct an array of 19 Movie objects (call the array films)

Develop a School java project Project Description: Programming java, threads. Not so hard but requires knowledgeSkills required: Java