Connecting Tech Pros Worldwide Help | Site Map

Which is better for transfer data: Attributes or Elements?

  #1  
Old November 1st, 2008, 12:45 PM
afshar
Guest
 
Posts: n/a
I want to use XML to import/export some data. My data is like a
database record like an employee information. I'm wondering which is
better to use: saving data in attributes or saving them in elements. A
typical XML may contain hundred to thousands of data. See following:

using elements:
....
<employee>
<name>john</name>
<age>45</age>
<salary>52000<salary>
</employee>
....

OR

using attributes:
....
<employee name="john" age="45" salary="52000">
....

?
  #2  
Old November 1st, 2008, 01:35 PM
Phil Jollans
Guest
 
Posts: n/a

re: Which is better for transfer data: Attributes or Elements?


I'm not an expert on XML, but by chance I just read the web page
http://www.firstobject.com/dn_xmlversioning.htm

You might find point 2 "Only use the data value of elements that are atomic"
interesting.

Phil


  #3  
Old November 1st, 2008, 11:45 PM
Peter Flynn
Guest
 
Posts: n/a

re: Which is better for transfer data: Attributes or Elements?


afshar wrote:
Quote:
I want to use XML to import/export some data. My data is like a
database record like an employee information. I'm wondering which is
better to use: saving data in attributes or saving them in elements. A
typical XML may contain hundred to thousands of data. See following:
This is an FAQ, see http://xml.silmaril.ie/developers/attributes/

///Peter
Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
Asp.net Important Topics. shamirza answers 0 January 18th, 2007 05:15 AM
.Net frameword Resources ( vb.net , asp.net etc...) shamirza answers 0 January 17th, 2007 08:05 AM
Can't make this page work scottyman@comcast.net answers 6 March 9th, 2006 04:25 AM
Unification of Methods and Functions David MacQuigg answers 99 July 18th, 2005 12:28 PM