Ananda has asked for the wisdom of the Perl Monks concerning the following question:

Hello monks, Greetings!!!

I intend to populate a combo with 3 lever hierarchical data defined in xml file and maintaining the hierarchy in the combo listing using 4 blank spaces as delimiters at each level.

Listed below is a sample xml data.

<?xml version="1.0" encoding="utf-8" ?>
<record name="TestPromp" type="content">

<item>
<value>Credit cards

<item><value>Gold</value></item>
<item><value>Platinum</value></item>
</value>
</item>

<item>
<value>Insurance

<item>
<value>Life Insurance

<item><value>Individual</value></item>
<item><value>Family</value></item>
</value>
</item>
<item>
<value>Vehicle insurance

<item><value>Car</value></item>
<item><value>HTV</value></item>
</value>
</item>
</value>
</item>
</record>

Hope the above description is clear

Dear monks, all your guidance is highly appriciated

Thanks in advance

Ananda
  • Comment on Populating a combo box with data in a xml file

Replies are listed 'Best First'.
Re: Populating a combo box with data in a xml file
by PodMaster (Abbot) on Jul 07, 2004 at 06:49 UTC
    And the question is, how to do it? Well, first you read the XML (using one of those XML modules on cpan), and then you generate the html. Which part are you having trouble with?

    MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!"
    I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README).
    ** The third rule of perl club is a statement of fact: pod is sexy.

Re: Populating a combo box with data in a xml file
by neniro (Priest) on Jul 07, 2004 at 07:22 UTC
    It looks like you want to fill different combo-boxes. Your XML is strange nested, so you'll possibly run in trouble.