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
Question Using 3 level of nested for loop, write a program that will produce the output as below.


What are synchronized methods and synchronized statements? Synchronized methods are methods that are used to control access to an object. A thread only implements a synchronize

Write a program called Power that displays the positive powers of 2. When the user enters the exponent at a prompt, the program displays 2 to that power. The program halts when the

In JavaScript, what is event handling? What are the two types of events? In JavaScript capturing events and responding to them is event handling. The system sends events to the

student are required to construct classes for circle,triangle,trapezium and kite.

we can insert elements at rear and remove at front bt my question is that how we insert at front in circular queue

Website for swapping/selling books Project Description: Seeking a website where students can sell and buy books. I want them to swap books as well. Payment options are requir

A fictitious train company, 'Transrail', has commissioned you to write a program that manages a list of train tickets. The program should display a text menu that prompts the us

A JSP page is a text-based document that having two types of text: static template data, which can be expressed in any text-based format like HTML, SVG, WML, and XML, and JSP eleme