Skip Menu |

This queue is for tickets about the XML-Bare CPAN distribution.

Report information
The Basics
Id: 65277
Status: resolved
Priority: 0/
Queue: XML-Bare

People
Owner: cpan [...] codechild.com
Requestors: hardik.a.joshi [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.50
Fixed in: (no value)



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
This has been updated in 0.49 in order to work this way. Note that this -only- occurs if the 'content' is something besides spaces or carriage returns. If the content is only spacing of those types, then content will not be set. Please note that the simple mode of XML::Bare refers to 'Simple XML', not to the 'XML::Simple' module. 'Simple XML' is XML that does not contain mixed content. This sort of behavior was not intended when the simple mode for XML::Bare was initially created. Minimal changes will be made to the module to attempt to help people attain a similar type of functionality as XML::Simple, but ultimately I will not be changing the module to be identical to XML::Simple. On Mon Jan 31 05:30:15 2011, hardik wrote: Show quoted text
> My xml structure > > <root> > <node1 attr1=val1 attr2=val2> > nodeval1 > </node1> > </root> > > where as XML::Simple give me output as below. > > 'node1' => { > 'attr2' => 'val2', > 'attr1' => 'val1', > 'content' => 'nodeval1' > } >