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

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top