Subject: | Bug in XMLout |
Date: | Wed, 10 Oct 2007 17:27:05 +0300 |
To: | bug-XML-Simple [...] rt.cpan.org |
From: | "Joni Laaksonen" <joni.laaksonen [...] gmail.com> |
Hi.
I wonder if I found a bug from the code or if I'm using it in the wrong way.
Here's what's happening:
-------------------------------------------------------------------------------------
First: my $hashref = $parser->XMLin($file, KeepRoot => 1);
$file contains:
<settings>
<test_1>
<test_2>
<test_3>
<test_4>abcd</test_4>
<test_5>1234</test_5>
</test_3>
</test_2>
</test_1>
</settings>
-------------------------------------------------------------------------------------
Second: print Dumper $xmlref;
Result:
$VAR1 = {
'settings' => {
'test_1' => {
'test_2' => {
'test_3' => {
'test_4'
=> 'abcd',
'test_5'
=> '1234'
}
}
}
}
};
-------------------------------------------------------------------------------------
Third: my $xml = XMLout( $hashref, AttrIndent => 1, KeepRoot => 1, NoAttr =>
1 ); print Dumper $xml;
Result:
$VAR1 = '<settings>
<test_1>
<name>test_2</name>
<test_3>
<test_4>abcd</test_4>
<test_5>1234</test_5>
</test_3>
</test_1>
</settings>
';
-------------------------------------------------------------------------------------
Fault:
Nested <test_2> has turned into <name>test_2</name>.
-------------------------------------------------------------------------------------
Environment:
# $Id: Simple.pm,v 1.40 2007/08/15 10:36:48 grantm Exp $
($VERSION = '2.18';)
This is perl, v5.6.1 built for MSWin32-x86-multi-thread (ActiveState)
- Joni