我有一个用XML :: Simple打开的xml文件,现在我想用XML :: Smart
所以有一种方法可以在XML :: Smart
中打印它print XMLout( \%clean_xml, NoAttr => 1, RootName => $root_key, XMLDecl => 1 );
由于
答案 0 :(得分:0)
来自POD:CREATING-XML-DATA
## Create a null XML object:
my $XML = XML::Smart->new() ;
## Add a server to the list:
$XML->{server} = {
os => 'Linux' ,
type => 'mandrake' ,
version => 8.9 ,
address => '192.168.3.201' ,
} ;
## The data now:
## <server address="192.168.3.201" os="Linux" type="mandrake" version="8.9"/>
## Or save it directly:
$XML->save('newfile.xml') ;