thandi has asked for the wisdom of the Perl Monks concerning the following question:
List All <AI> tags within the <AC n="CCC">
List only <AI> tags and its <Desc> within the <AC n="CCC">
List all <ID> tags and its <Desc> within <AI n="AAA">
etc...
This means that I need to extract differing info depending on the command line given on the command line:
Here's the 'modified' XML file:
tks thandi<World n="earth" > <Space n="XXX" > <CL n="XXX"> <Desc>CL desc</Des> <Other/> <AC n="AAA" set="n"> <Desc>AC AAA desc</Desc> <AI n="AAA" set="n"> <Desc>AI AAA desc</Desc> <ID n="AAA" set="y"> <Desc>AAA ID desc</Desc> <What>What AAA ID </What> <AR>ID_aaa</AR> </ID> <ID n="BBB" set="y"> <Desc>BBB ID desc</Desc> <What>What BBB ID </What> <AR>ID_bbb</AR> </ID> </AI> <AI n="BBB" set="y"> <Desc>AI BBB desc</Desc> <ID n="AAA" set="y"> <Desc>AAA ID desc</Desc> <What>What AAA ID </What> <AR>ID_aaa</AR> </ID> </AI> </AC> <AC n="CCC" set="y"> <AI n="AAA" set="n"> <Desc>AI AAA desc</Desc> <ID n="AAA" set="y"> <Desc>AAA ID desc</Desc> <What>What AAA ID </What> <AR>ID_aaa</AR> </ID> </AI> <AI n="AAA" set="n"> <Desc>AI AAA desc</Desc> <ID n="AAA" set="y"> <Desc>AAA ID desc</Desc> <What>What AAA ID </What> <AR>ID_aaa</AR> </ID> </AI> </AC> <CL n="XXX"> <Space n="XXX" > <World n="earth" >
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: XML::Twig question
by Tanktalus (Canon) on Dec 12, 2006 at 14:48 UTC | |
|
Re: XML::Twig question
by zentara (Cardinal) on Dec 12, 2006 at 15:55 UTC | |
|
Re: XML::Twig question
by mirod (Canon) on Dec 12, 2006 at 16:28 UTC | |
by thandi (Novice) on Dec 12, 2006 at 19:15 UTC | |
by mirod (Canon) on Dec 12, 2006 at 19:52 UTC | |
by Bizza (Initiate) on Dec 19, 2006 at 21:50 UTC | |
by mirod (Canon) on Dec 19, 2006 at 22:28 UTC | |
| |
|
Re: XML::Twig question
by Jenda (Abbot) on Dec 29, 2006 at 15:46 UTC |