Subject: | XML-Writer-Nest-0.04 |
Date: | Sat, 4 Jul 2009 17:47:33 +0100 |
To: | bug-xml-writer-nest [...] rt.cpan.org |
From: | Ian Shrimpton <ian [...] persistentmobile.com> |
Environment:
XML-Writer-Nest-0.04
perl 5.8.8
Linux 2.6.18-1.2849.fc6
Description:
Unable to nest elements at same level within element, elements are
closed in incorrect order
Code:
#!/usr/bin/perl
use strict;
use XML::Writer::Nest;
my $output;
my $writer = new XML::Writer(OUTPUT => $output);
my $main = new XML::Writer::Nest(tag => 'main', writer => $writer);
my $head = $main->nest('head');
my $body = $main->nest('body');
print STDOUT $output . "\n\n";
Result:
<main><head><body></body></head></main>
Expected Result:
<main><head></head><body></body></main>