and the same for item2... for example, generate this output: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);
but the OUTPUT must be:<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" />
where I have to put the code? thankyou very much for your precious help<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" />
In reply to Re^2: delete duplicated xml lines
by cibiena
in thread delete duplicated xml lines
by cibiena
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |