Hi
I am trying to write my first XML app and am having quite a bit of trouble. I'm not asking people to write my code for me here but I'd really appreciate it if you could at least point me in the right direction and tell me what approach I have to take please. I have a feeling that Ajax would be the best method.
Thank you.
**************************
**********
**********
**********
**********
**********
***
So what I'd like to do is populate a select box with my xml list of CENTRES, when the user chooses one I would like to output the selected CENTRE and under it the relevant SUBCENTRE/S for it in a list so it would look something like this:
CENTRE: Accounts Payable:
> Buying
Here is some info
Here is the deadline date
> Selling
Here is some info
Here is the deadline date
So two questions really:
1) How do I populate my select box with the CENTRES?
2) How to I output the results from the choice?
**************************
**********
**********
**********
**********
**********
**
So this is my xml file right? But I don't really know if it's right or where to go from here.
<?xml version='1.0'?>
<!DOCTYPE CENTRE [
<!ELEMENT CENTRE (SUBCENTRE+)>
<!ELEMENT SUBCENTRE (NAME,DEADLINE)>
<!ELEMENT NAME (#PCDATA)>
<!ELEMENT DEADLINE (#PCDATA)>
]>
<CENTRES>
<CENTRE>
<NAME>CENTRE 1</NAME>
<SUBCENTRES>
<SUBCENTRE>
<TITLE>SubCENTRE 1a</TITLE>
<DEADLINE>1st Jan</DEADLINE>
</SUBCENTRE>
<SUBCENTRE>
<TITLE>SubCENTRE 1b</TITLE>
<DEADLINE>1st March</DEADLINE>
</SUBCENTRE>
</SUBCENTRES>
</CENTRE>
<CENTRE>
<NAME>CENTRE 2</NAME>
<SUBCENTRES>
<SUBCENTRE>
<TITLE>SubCENTRE 2a</TITLE>
<DEADLINE> 1st Feb</DEADLINE>
</SUBCENTRE>
<SUBCENTRE>
<TITLE>SubCENTRE 2b</TITLE>
<DEADLINE>3rd Nov</DEADLINE>
</SUBCENTRE>
</SUBCENTRES>
</CENTRE>
</CENTRES>
Start Free Trial