With perl and libxml how to import a child element from a simple `txt` file?

se502

New Member
I have a ready xml document object and i want to import a child from a file which normaly can have element tags then i need to parse that file to a new element object and add it to the ready xml document object.i used this method:\[code\]my $txt = "<div>";open(TEST,"/path/to/file");while(<TEST>){$txt .= $_}close(TEST);$txt .= "</div>";my $child = (XML::LibXML->new())->parse_balanced_chunk($txt);$cell_center->addChild($child);\[/code\]But it doesn't work. How do i do this properly?
 
Back
Top