Elements X Attributes

1 view
Skip to first unread message

Patrick Maia

unread,
Apr 24, 2008, 8:09:42 AM4/24/08
to XML Schema
Hi all, I'm designing a XML document and I'd like to know if there is
a recommendation in when I should use attributes or elements to hold a
property in an object. Example:

What's better?

this:

<person age="22">
<gender>male</gender>
</person>

or this:

<person>
<age>22</age>
<gender>male</gender>
</person>

msbalaji

unread,
Apr 28, 2008, 11:48:07 PM4/28/08
to XML Schema
Hi,

<person>
<age>22</age>
<gender>male</gender>
</person>

Second method is good one. It's easy to process.

Regards,
Balaji. M
Reply all
Reply to author
Forward
0 new messages