Advertisement

12.20.2007 at 02:16PM PST, ID: 23037158 | Points: 500
[x]
Attachment Details

How to parse XML while keeping nodes in order in Perl hash?

Asked by timdr in Perl Programming Language

Tags: order, parse

Hello,

I need to read in a layout of items stored in XML into a Perl hash.  That means the order in which items appear and the groupings of the items are important.  The names of each item and group must be preserved as well.  Does someone know of a module or can provide some code that will accomplish this?  Please see the attached XML for a sample of the layout of items.Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
<config>
    <group name="Group1">
        <item name="item1"/>
        <item name="item2"/>
        <group name="Subgroup1">
            <item name="item3"/>
            <item name="item4"/>
        </group>
        <group name="Subgroup2">
            <item name="item5"/>
            <item name="item6"/>
        </group>
        <item name="item7"/>
    </group>
    <service name="item8"/>
</config>
[+][-]12.20.2007 at 02:23PM PST, ID: 20510411

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]12.20.2007 at 02:41PM PST, ID: 20510521

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]12.20.2007 at 06:29PM PST, ID: 20511375

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]12.21.2007 at 12:09PM PST, ID: 20516040

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]12.21.2007 at 12:20PM PST, ID: 20516118

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]12.21.2007 at 01:07PM PST, ID: 20516345

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]12.21.2007 at 01:33PM PST, ID: 20516506

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]12.21.2007 at 02:01PM PST, ID: 20516683

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]12.21.2007 at 05:32PM PST, ID: 20517378

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628