xmlxsd

XML Data Structure


Which one of two XML structures below do you prefer? Why? Any other suggestion is welcome :)

<Parameters>
  <Parameter id="username">metdos</Parameter>
  <Parameter id="password">123</Parameter>
</Parameters>

or

<Parameters>
  <username>metdos</username>
  <password>123</password>
</Parameters>

Solution

  • Although the design of an XML structure may be a matter of preference, I like the second one. Your question seems to be one that has been discussed many times. The following links should be of help.