Thankyou very much for your answer, but sorry I'am novice in perl and is very difficult for me. this is a little part of my code:
my $materialmapping_table_xml = XML::LibXML->createDocument( "1.0", "U +TF-8"); my $materialmapping_table_xml_root = $materialmapping_table_xml->creat +eElement("masterdata"); $materialmapping_table_xml->setDocumentElement($materialmapping_table_ +xml_root); my $materialmapping_item3 = $materialmapping_table_xml->createElement( +"item3"); $materialmapping_item3->setAttribute(decode('cp1252',$pr_cell_name3->{ +Val}),$pr3); $materialmapping_item3->setAttribute("pr_family",$family); $materialmapping_table_xml_root->addChild($materialmapping_item3);
and the same for item2... for example, generate this output:
<item2 duble="1" pr="c" pr_width="1250" pr_family="2" /> <item2 duble="2" pr="c" pr_width="1250" pr_family="2" /> <item2 pr="a" duble="2" pr_width="1250" pr_family="2" /> <item2 pr="b" duble="2" pr_width="1250" pr_family="2" /> <item2 pr="c" duble="2" pr_width="1250" pr_family="2" /> <item3 pr="a" duble="1" pr_width="1250" pr_family="2" /> <item3 pr="b" duble="1" pr_width="1250" pr_family="2" /> <item3 pr="c" duble="1" pr_width="1250" pr_family="2" /> <item3 pr_width="1250" duble="1" pr="c" pr_family="2" /> <item3 pr="a" duble="2" pr_width="1250" pr_family="2" /> <item3 pr="b" duble="2" pr_width="1250" pr_family="2" /> <item3 pr="c" duble="2" pr_width="1250" pr_family="2" /> <item3 pr_width="1250" duble="2" pr="c" pr_family="2" /> <item3 pr_width="1250" pr="c" duble="2" pr_family="2" /> <item3 pr_width="1250" pr="c" duble="2" pr_family="2" /> <item3 pr_width="1250" pr="c" duble="2" pr_family="2" /> <item2 pr="a" duble="3" pr_width="1250" pr_family="2" />
but the OUTPUT must be:
<item3 pr="a" duble="1" pr_width="1250" pr_family="2" /> <item3 pr="b" duble="1" pr_width="1250" pr_family="2" /> <item3 pr="c" duble="1" pr_width="1250" pr_family="2" /> <item3 pr="a" duble="2" pr_width="1250" pr_family="2" /> <item3 pr="b" duble="2" pr_width="1250" pr_family="2" /> <item3 pr="c" duble="2" pr_width="1250" pr_family="2" /> <item2 pr="a" duble="3" pr_width="1250" pr_family="2" />
where I have to put the code? thankyou very much for your precious help

In reply to Re^2: delete duplicated xml lines by cibiena
in thread delete duplicated xml lines by cibiena

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.