Results 1 to 2 of 2

Thread: XML: Attribute or Value?

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 1999
    Location
    Prague, Czech Republic
    Posts
    350

    Unhappy XML: Attribute or Value?

    Hi,
    I'm quite confused what I should choose.
    Let's say I have a XML file for calendar.

    Is is better to use
    <Birthday>
    <Name>Sister</Name>
    <Month>8</<Month>
    <Day>24</Day>
    </Birthday>

    or
    <Birthday Name="Sister" Month="8" Day="24 />
    or even <Birthday MonthDay="24.8.">Sister</Birthday>?

    What's the difference?

  2. #2
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431
    I definately wouldn't do your 3rd idea, but there is not much difference between 1 and 2 and it's really an implementation decision. Just determine how you are going to use the data and which is easier.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width