1

Please humor me. I have managed to create a question and answer framework with Jquery and XML files. The user selects which category of questions he/she wants to practice from a drop down menu. On selection, the XML file (which the question and answer category relates to) is parsed by the Jquery function and displayed for the user.

The Jquery function works well for my purposes, but I now have many, many XML question & answer files. I want to present them to the user via specific file groups and subgroups. So I need a drop down menu with initial levels of groups and subgroups, and a final level of options that will allow the user to select which XML file to parse. I would like the subgroups to and XML file options to appear to the user in horizontal fashion. The below structure is able to group my XML files...

http://cryptexo.wordpress.com/2010/07/23/multi-level-select-box-in-simple-html/

But it still just creates a vertical list and the user will take too much time looking for the XML file that he/she wishes to parse.

I have found many examples that use CSS to present horizontal navigation options to the user...

http://www.bloggermint.com/2011/06/pure-css3-multi-level-drop-down-navigation-menu/

But these examples do not incorporate the html selection form that is needed for the user to select and parse the XML files.

I have attempted blend an html selection form into the CSS-related structure, but no cigar at this stage.

If anybody has read this and understands what I would like to do...and knows a method by which I can do it...I would be very grateful if they enlightened me.

Thank alot, guys.

AndrewC
  • 41
  • 4

1 Answers1

0

Instead of hot-linking to the xml files -

You can save an array of their sources - and load them from this.

var xmls = ['1.xml', '2.xml']; //for 1-dimensional

If you have a hierarchy

xmls = [{
   levelName : '1',
   subLevels : [{ levelName : '1.1', xml : '1.1.xml', sub-levels : [] .. }]
},
{
   levelName : '2',
   xml : '2.xml' //no sub levels here
}
.
.
];

You can then use this array to create your drop-down as required.

Robin Maben
  • 22,194
  • 16
  • 64
  • 99
  • Cheers for that, mate. I will look into it. Do you have a link or a search term I can google to find more details? Thanks heaps. – AndrewC Sep 05 '12 at 01:50
  • @AndrewC: You could probably dig further into [Json trees](http://stackoverflow.com/questions/2294695/creating-a-json-tree-from-a-string-hierarchy) and [XML usage and transformation in HTML pages](http://stackoverflow.com/questions/4682904/i-want-to-link-my-xml-file-to-my-html-page) – Robin Maben Sep 05 '12 at 05:58