Home: Perl Programming Help: Intermediate:
XML and Perl



Srivathsan Kris
Deleted

Nov 21, 2000, 10:11 AM


Views: 752
XML and Perl

Hi All
How do i append a child element to the following code ?

use XML::DOM;

my $doc = new XML::DOM::Document;
my $root = $doc->createElement ("PersonalInfo");
print $doc->toString;


Thanks in Advance


Srivathsan


Srivathsan Kris
Deleted

Nov 21, 2000, 6:05 AM


Views: 752
Re: XML and Perl

Hello Folks


I got the answer .Probably u guys can use this !


use XML::DOM;
use XML::Element;

my $doc=new XML::DOM::Document;
my $root=$doc->createElement("PersonalInfo");

my $child1=$doc->createElement("Name");
$root->appendChild($child1);

print $root->toString;

Bye

Srivathsan