1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2004
    Rep Power

    Help needed with XML file structure


    I'm a newbie to XML, with a problem. I want to create an XML file of events. Each event has a name, date and a number of links associated with it.

    So it would be :
    Name: Dogs v Cats
    Date: 12/12/2013
    Link: http://www.link1.com
    Link: http://www.link2.com
    Link: http://www.link3.com

    Name: Birds v Ferrets
    Date: 11/12/2013
    Link: http://www.link4.com
    Link: http://www.link5.com
    Link: http://www.link6.com

    Any idea on the best way to structure my XML file?

    Thanks in advance!
  2. #2
  3. Impoverished Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Washington, USA
    Rep Power
    Each of those is some type of thing. I'll guess at them being "events". (Could be shows or movies or whatever.) There's always a handful of options for how the XML looks and which you choose kinda depends on the tools you're using - one option may be easier to work with than another.

    Example 1: no attributes, typically easier to use
    <?xml version="1.0" encoding="utf-8"?>
    		<name>Dogs v Cats</name>
    Example 2: with attributes, looks cleaner (IMO)
    <?xml version="1.0" encoding="utf-8"?>
    	<event name="Birds v Ferrets" date="11/12/2013">

IMN logo majestic logo threadwatch logo seochat tools logo