in reply to Re^3: XML::Twig question
in thread XML::Twig question
1. List All ACs in xml document result should be: AC desc AC=CCC, CL=CCC AC desc AC=AAA, CL=CCC # these are the <Desc> element just bel +ow start tag <AC> also need to be able to update the text if requeste +d. 2. List all AIs in a given AC, eg AC=CCC result should be: AI desc AI=BBB, AC=CCC AI desc AI=XXX, AC=CCC 3. List all <ID> nodes in a given <AI n="XXX"> result should be: a. ID desc ID=XXX, AI=BBB, AC=CCC What XXX ID ID_XXX b. ID desc ID=ZZZ, AI=BBB, AC=CCC What ZZZ ID ID_ZZZ The based on the user selection, I need to update the requested text w +ithin an element or add a whole new node. <World n="earth" > <Space n="XXX"> <CL n="XXX"> <Desc>Class description</Desc> <Other/> <AC n="AAA" set="n"> <Desc>AC desc AC=AAA, CL=CCC</Desc> <AI n="AAA" set="n"> <Desc>AI descr AI=AAA, AC=AAA</Desc> <ID n="AAA" set="y"> <Desc>ID desc ID=AAA, AI=AAA, AC=AAA</Desc> <What>What ID=AAA AI=AAA, AC=AAA</What> <AR>ID_aaa</AR> </ID> <ID n="BBB" set="y"> <Desc>ID desc ID=BBB, AI=AAA, AC=AAA</Desc> <What>What ID=BBB AI=AAA, AC=AAA</What> <AR>ID_bbb</AR> </ID> </AI> <AI n="BBB" set="y"> <Desc>AI desc, AI=BBB, AC=AAA</Desc> <ID n="AAA" set="y"> <Desc>ID desc ID=AAA, AI=BBB, AC=AAA</Desc> <What>What AAA ID=BBB, AI=BBB, AC=AAA </What> <AR>ID_bbb</AR> </ID> </AI> </AC> <AC n="CCC" set="y"> <Desc>AC desc ACC=CCC, CL=CCC</Desc> <AI n="AAA" set="n"> <Desc>AI desc AI=BBB, AC=CCC</Desc> <ID n="AAA" set="y"> <Desc>ID desc ID=AAA, AI=AAA, AC=CCCC</Desc> <What>What AAA ID=AAA, AI=AAA, AC=CCC </What> <AR>ID_aaa</AR> </ID> </AI> <AI n="XXX" set="n"> <Desc>AI desc AI=XXX, AC=CCC</Desc> <ID n="XXX" set="y"> <Desc>ID desc ID=XXX, AI=BBB, AC=CCC</Desc> <What>What XXX ID </What> <AR>ID_XXX</AR> </ID> <ID n="ZZZ" set="y"> <Desc>ID desc ID=ZZZ, AI=BBB, AC=CCC</Desc> <What>What ZZZ ID </What> <AR>ID_ZZZ</AR> </ID> </AI> </AC> </CL> </Space> </World>
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: XML::Twig question
by mirod (Canon) on Dec 19, 2006 at 22:28 UTC | |
by thandi (Novice) on Dec 20, 2006 at 10:23 UTC | |
by mirod (Canon) on Dec 20, 2006 at 13:35 UTC | |
by thandi (Novice) on Dec 20, 2006 at 14:33 UTC |