Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I am trying to use XML::Smart to create XML files.
Here is my code:
my $XML = XML::Smart->new();
$XML->{JOB}{NAME} = $job_name;
$XML->{JOB}{DESC} = $desc;
$XML->{JOB}{NUM} = $num;
Here is the output:
<JOB NAME="Name goes here" DESC="Description" NUM="Num goes here"/>
I want it to look like this:
<JOB NAME="Name goes here">
<DESC>Description</DESC>
<NUM>Description</NUM>
</JOB>
The problem is that I can't create single nodes. The data is all contained in the main node. Any advice would be appreciated. Thanks!
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: How do you create sub-nodes with XML::Smart
by ramrod (Curate) on Mar 03, 2009 at 16:41 UTC | |
by Anonymous Monk on Mar 03, 2009 at 19:34 UTC | |
by ramrod (Curate) on Mar 03, 2009 at 20:58 UTC | |
by Anonymous Monk on Mar 03, 2009 at 22:02 UTC |
Back to
Seekers of Perl Wisdom