troubleshooting Question

XML/AJAX select box and results output

Avatar of Lady_M
Lady_MFlag for United Kingdom of Great Britain and Northern Ireland asked on
JavaScriptWeb ApplicationsXML
13 Comments6 Solutions283 ViewsLast Modified:
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>
ASKER CERTIFIED SOLUTION
steveberzins

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Log in to continue reading
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform for $9.99/mo
View membership options
Unlock 6 Answers and 13 Comments.
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
The Value of Experts Exchange in My Daily IT Life

Experts Exchange (EE) has become my company's go-to resource to get answers. I've used EE to make decisions, solve problems and even save customers. OutagesIO has been a challenging project and... Keep reading >>

Mike

Owner of Outages.IO
Phoenix, Arizona, United States
Member Since 2016
Join a full scale community that combines the best parts of other tools into one platform.
Unlock 6 Answers and 13 Comments.
View membership options
“All of life is about relationships, and EE has made a virtual community a real community. It lifts everyone's boat.”
William Peck

Member since 2004