Which is better for transfer data: Attributes or Elements?

A

afshar

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">
....

?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,997
Messages
2,570,241
Members
46,833
Latest member
BettyeMacf

Latest Threads

Top