Below are the queries that I need to formulate based on the xml at the bottom. I'll also have to add a new node e.g starting from the <ID>..</ID> tks before hand thandi
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>

In reply to Re^4: XML::Twig question by Bizza
in thread XML::Twig question by thandi

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.