MIME-Version: | 1.0 |
X-Spam-Status: | No, hits=-2.6 required=8.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VERIFIED,DK_SIGNED,HTML_MESSAGE,SPF_PASS |
X-Virus-Checked: | Checked |
Content-Type: | multipart/alternative; boundary="----=_Part_52582_9030311.1192026425103" |
Received: | from la.mx.develooper.com (x1.develooper.com [63.251.223.170]) by diesel.bestpractical.com (Postfix) with SMTP id 2F7D14D80A5 for <bug-XML-Simple@rt.cpan.org>; Wed, 10 Oct 2007 10:47:26 -0400 (EDT) |
Received: | (qmail 12312 invoked by alias); 10 Oct 2007 14:27:25 -0000 |
Received: | from py-out-1112.google.com (HELO py-out-1112.google.com) (64.233.166.179) by la.mx.develooper.com (qpsmtpd/0.28) with ESMTP; Wed, 10 Oct 2007 07:27:17 -0700 |
Received: | by py-out-1112.google.com with SMTP id u77so410276pyb for <bug-XML-Simple@rt.cpan.org>; Wed, 10 Oct 2007 07:27:06 -0700 (PDT) |
Received: | by 10.65.81.10 with SMTP id i10mr1627793qbl.1192026425112; Wed, 10 Oct 2007 07:27:05 -0700 (PDT) |
Received: | by 10.64.196.16 with HTTP; Wed, 10 Oct 2007 07:27:05 -0700 (PDT) |
Delivered-To: | cpan-bug+xml-simple@diesel.bestpractical.com |
Subject: | Bug in XMLout |
Return-Path: | <joni.laaksonen@gmail.com> |
Domainkey-Signature: | a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:mime-version:content-type; b=tl4tjBAjbfRIsU4lQ4MdrIUYgIC/bNtklO1rSTg2QfsJyNGAYtM5kLaHm24yFuphEUHsxjCuDVWViURw7j+smCtfpOgNWeGjK2FjiiFGjs1w8egDg+N/dPxYGofOdJ+WxCEtXCymral6GkmRiHrtfsYRMHuY5yH7mRkhhEwkQZY= |
X-Original-To: | bug-XML-Simple@rt.cpan.org |
X-Spam-Check-BY: | la.mx.develooper.com |
Dkim-Signature: | v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type; bh=wK37KSSUtg5bfAu8o9/3iU7W4Ax4FzjRuaWeALlTUxk=; b=rEqNGjiP0FOd0YVwgIY5/Rtky74q/IGMU+q+X+g8gw0FJwhU82N8UVY/5TamCryipKvduu4rwp16Y6jDYUgY3lHuFUOYjPPe+zdzSRNuxi4ZPL6jS/GUEhRjyCHE6YnAiRjSY7PfXQm5W+mykJXY3JSUoy3RvYoEBNrWPTaHRfc= |
Date: | Wed, 10 Oct 2007 17:27:05 +0300 |
Message-Id: | <b884767f0710100727j132cc4cdp29685486fca812cd@mail.gmail.com> |
To: | bug-XML-Simple@rt.cpan.org |
From: | "Joni Laaksonen" <joni.laaksonen@gmail.com> |
Content-Length: | 0 |
content-type: | text/plain; charset="utf-8" |
Content-Disposition: | inline |
Content-Transfer-Encoding: | 7bit |
X-RT-Original-Encoding: | ISO-8859-1 |
Content-Length: | 1910 |
Content-Type: | text/html; charset=ISO-8859-1 |
Content-Disposition: | inline |
Content-Transfer-Encoding: | quoted-printable |
X-RT-Original-Encoding: | ISO-8859-1 |
Content-Length: | 5296 |
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>
<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'
}
}
}
}
};
'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>
';
<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