Or XML::LibXML
!/usr/bin/perl use strict; use warnings; use XML::LibXML; my $xml = <<'XML'; <FILER url='http://somewhere'> <PROJECT name='test_project'/> <USER email='some@email.com'/> </FILER> XML my $parser = XML::LibXML->new(); my $doc = $parser->parse_string( $xml ); my $node = $doc->createElement( 'LOCATION' ); $node->setAttribute( 'name', '1stFloor' ); my $root = $doc->documentElement(); $root->appendChild( $node ); print $doc->toString(), "\n";
In reply to Re^2: XML handling
by derby
in thread XML handling
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |