tags:

views:

67

answers:

2

How to describe element having more than one value in xml ? e.g indian criketer are more than one name so to store data about it how can we store

is following tag is correct

< indian_criketer> sachin,rahul,ganguly

+7  A: 

Generally, you would use an outer wrapping element for your list and an inner element for the values:

<cricketers>
  <cricketer>sachin</cricketer>
  <cricketer>rahul</cricketer>
  <cricketer>ganguly</cricketer>
</cricketers>
bobbymcr
A: 

Your approach is not wrong, but it will be difficult for you to list cricketers if you use the approach that you are using. So the easier way is this one:

<indian_criketer_list>
 <cricker_name>sachine</cricker_name>
 <cricker_name>rahul</cricker_name>
 <cricker_name>ganguly</cricker_name>
</indian_criketer_list>
ajitdh
duplicate answer..you could have just upvoted the above answer
Learner
It would be best to put "indian" as an attribute instead of a name tag, oif we want to be pedantic about our XML design :)I'm kind of assuming other people play cricket outside of India :)
DVK
ya i could have upvoted the above answer, but i only see that answer after writing my answer. :S
ajitdh