Go Back   CodingForums.com > :: Client side development > XML

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 09-09-2012, 01:36 PM   PM User | #1
metcala
New to the CF scene

 
Join Date: Sep 2012
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
metcala is an unknown quantity at this point
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!
metcala is offline   Reply With Quote
Old 09-09-2012, 04:53 PM   PM User | #2
Alex Vincent
Moderator


 
Join Date: May 2002
Location: Hayward, CA
Posts: 1,427
Thanks: 1
Thanked 19 Times in 17 Posts
Alex Vincent is on a distinguished road
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
Alex Vincent is offline   Reply With Quote
Old 09-09-2012, 05:13 PM   PM User | #3
metcala
New to the CF scene

 
Join Date: Sep 2012
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
metcala is an unknown quantity at this point
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!
metcala is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 04:58 AM.


Advertisement
Log in to turn off these ads.