I want to create an xml document that has multiple instance of a type, not sure what’s the proper way to do this:
<farm>
<horses>
<horse name="jo"></horse>
<horse name="bill"></horse>
</horses>
</farm>
or should I skip the tag and just do this:
<farm>
<horse name="jo"></horse>
<horse name="bill"></horse>
</farm>
which way is correct?
Thanks
It’s xml, you’re free to choose whatever you like best 🙂
Seriously – both are ok; but think about who you want to please.
As a programmer that would need to consume XML, I would like the first form better.
As an editor that would need to manually create XML I would like the second form better.
I guess i would probably settle for the first form.