Hi
I am new user and I have little question , about perl and DOM
The target of the following perl scrip (shown down)  is to create XML file 
(test.xml) as the following:
<books>
<computer/>
</books>
But after running the perl script I get in the test.xml only: (<?xml 
version="1.0"?>) without other element lines
Yael

#!/usr/bin/perl


use XML::LibXML;
my $doc;


$doc = XML::LibXML::Document->new;

my $objbooks = $doc->createElement('books');
$doc->appendChild($objbooks);

my $objcomputer = $doc->createElement('computer');
$objbooks->appendChild($objcomputer);

$doc->toFile('/var/tmp/test.xml');




more test.xml

<?xml version="1.0"?>



  ________________________________
"This e-mail message may contain confidential, commercial or privileged 
information that constitutes proprietary information of Comverse Technology or 
its subsidiaries. If you are not the intended recipient of this message, you 
are hereby notified that any review, use or distribution of this information is 
absolutely prohibited and we request that you delete all copies and contact us 
by e-mailing to: [email protected]. Thank You."
_______________________________________________
Perl mailing list
[email protected]
http://mail.perl.org.il/mailman/listinfo/perl

Reply via email to