Subject: | Bug while parse using simple or xmlin function |
Hello,
I was trying to replace my existing code from XML::Simple to XML::Bare.
I was trying to use simple() or xmlin() to perform task which might save
my time to utilize my existing code.
I found bug which parsing scenario as below.
My xml structure
<root>
<node1 attr1=val1 attr2=val2>
nodeval1
</node1>
</root>
if I parse using simple() or xmlin()
code:
my $str = "<root>
<node1 attr1=val1 attr2=val2>nodeval1</node1>
</root>";
my $xml_bare = XML::Bare->new(text => $str);
my $parse = $xml_bare->simple();
I am getting below output:
'root' => {
'node1' => {
'attr2' => 'val2',
'attr1' => 'val1'
}
}
here I lost value of node1.
where as XML::Simple give me output as below.
'node1' => {
'attr2' => 'val2',
'attr1' => 'val1',
'content' => 'nodeval1'
}
I was am working with latest version of XML::Bare with linux ubuntu
platform and my command to execute code is simple
perl test.pl
Thanks,
Hardik