Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Sep 2012
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    XML attributes advice

    Hey guys,

    I was wondering if anyone could give me a little bit of advice. I'm working on a project in which a user will enter details in a form and based on a couple of parameters a schedule will be returned. I was planning on using an XML document to store various schedules and using javascript to return the appropriate plan. I just wanted to know if this is a logical way to approach this?

    I've put a really quick example of the different elements I'm thinking. So for example the user would select Biology at level 1 in the initial form and a revision plan would be returned. Going forward I want to keep it flexible in how it can be returned so for example within week 1 the days can be swapped around (so people can sort their revision plan to suit themselves).

    Code:
    <?xml version="1.0" encoding="utf-8"?>
    <plan>
    	<subject category="Biology">	
    		<study level="1">
    			<week number="1">
    				<day number="1">
    					<session_description>Topic 1</session_description>
    				</day>
    			</week>
    		</study>
    	</subject>
    </plan>
    I'd be grateful if you could let me know what you think! Thanks guys, I really appreciate it!

  • #2
    Moderator
    Join Date
    May 2002
    Location
    Hayward, CA
    Posts
    1,459
    Thanks
    1
    Thanked 23 Times in 21 Posts
    Quote Originally Posted by metcala View Post
    I was planning on using an XML document to store various schedules and using javascript to return the appropriate plan. I just wanted to know if this is a logical way to approach this?
    First impression: Ask yourself the question: "Why not use a combination of PHP and MySQL?"

    Generic XML is one of those technologies that you really need a good reason to use. What you're talking about sounds more like a database, which XML is poorly suited for. Its wordiness works against you.

    XML is okay for transferring the information, but even raw data like this might be better off in JSON.
    "The first step to confirming there is a bug in someone else's work is confirming there are no bugs in your own."
    June 30, 2001
    author, Verbosio prototype XML Editor
    author, JavaScript Developer's Dictionary
    https://alexvincent.us/blog

  • #3
    New to the CF scene
    Join Date
    Sep 2012
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi Alex,

    Thanks for the quick reply! I don't really have any experience in MySQL I've just had a look into it and seems like something I could probably get to grips with. Thanks again for your response, definitely seems like a much more logical approach!


  •  

    Posting Permissions

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