in reply to Re^2: copy XML elements from one file to another
in thread copy XML elements from one file to another
how I can view my output file? I don't see any generated output filesYou can print directly to a file using the toFile() method. Add the following lines to the example given above:
$new->addChild($features); my $filename = 'new.xml'; my $ok = $new->toFile($filename,2);
I assume "parser" in this case will be parsing the source file (where im getting my input from) right?Yes, you would set up the parser like this, probably in a loop to go through each file:
my $file = 'file-1.xml'; my $parser = XML::LibXML->load_xml(location => $file);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: copy XML elements from one file to another
by Anonymous Monk on Nov 25, 2013 at 23:06 UTC | |
by tangent (Parson) on Nov 25, 2013 at 23:46 UTC | |
|
Re^4: copy XML elements from one file to another
by Anonymous Monk on Nov 26, 2013 at 05:11 UTC | |
by Corion (Patriarch) on Nov 26, 2013 at 13:23 UTC | |
by tangent (Parson) on Nov 26, 2013 at 13:20 UTC |