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

I need Liferay Especialist Project Description: We want a JAVA + JSF + Portlets expert Liferay expertise is needed Big Data and Online Tools + Multilingual Portal & Websit

What are Access Specifiers available in Java? Java has four access specifiers, which are enlisted below: Public: public methods, classes and fields can be accessed by ever

Determine how many arguments were passed using length property In java, array knows their size by using the length property. By using, length property we can determine how many

Translate Four Row Solitaires from Java Swing to Android. Project Description: There is a product known Four Row Solitaire listed in GitHub. I would like Swing GUI to be repl

What is the importance of static variable? Static variables are class level variables where all objects of the class refer to the similar variable. If one object alters the val

In Java everything exists within a class. It describes the behavior of the class and its characteristics. Java applications and applets are built in the class. Rules present for cl

Need to develop a Fantasy football Project Description: I am seeking to build a Fantasy football website. i already have an example of existing website. i want the exact same

The IncludeAction class is useful when you require to integrate Struts into an application that uses Servlets. Use the IncludeAction class to contain another resource in the respon