comp.text.xml
[Top] [All Lists]

Tags v.s. Attributes

Subject: Tags v.s. Attributes
From: gaijinco
Date: Tue, 8 Jul 2008 10:10:54 -0700 PDT
Newsgroups: comp.text.xml

I'm fairly new to using XML and I tend to be quite verbose when
writting files.

Is there any disadvantage of writting:

<person>
  <name first="Carlos" second="" />
  <lastname first="Obregon" second="Jimenez" />
  <id type="CC" number="79879389" />
  <birthday day="17" month="02" year="1979" />
  <member day="01" month="06" year="2007" />
  <adress id="Evegreen Cr. 1234" />
  <telephone number="555-123456" />
  <email user="me" domain="home.com" />
</person>

Intead of:

<person>
  <name>
    <first>Carlos</first>
    <second></second>
  </name>
  <lastname>
    <first>Obregon</first>
    <second>Jimenez</second>
  </lastname>
  <id>
    <type>CC</type>
    <number>79879389</number>
  </id>
  <birthday>
    <day>17</day>
    <month>02</month>
    <year>1979</year>
  </birthday>
  <member>
    <day>01</day>
    <month>06</month>
    <year>2008</year>
  </member>
  <adress>Evegreen Cr. 1234</adress>
  <telephone>555-123456</telephone>
  <email>
    <user>me</user>
    <domain>home.com</domain>
  </email>
</person>

Thanks.

<Prev in Thread] Current Thread [Next in Thread>
Privacy Policy