Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

bug in XML::Simple ?
I did this shell command

perl -e 'use XML::Simple qw(:strict); use Data::Dumper; print
Dumper(XMLin("<xxx><_a>b</_a></xxx>", 'ForceArray' => 1, KeyAttr => []))
' >
delete.txt

And the output was

$VAR1 = {
'__a' => [
'b'
]
};

I was aspecting

$VAR1 = {
'_a' => [
'b'
]
};

What am I doing wrong?

Marcos

Report this thread to moderator Post Follow-up to this message
Old Post
Marcos Rebelo
03-27-04 04:14 AM


Re: bug in XML::Simple ?
>
> I did this shell command
>
> perl -e 'use XML::Simple qw(:strict); use Data::Dumper; print
> Dumper(XMLin("<xxx><_a>b</_a></xxx>", 'ForceArray' => 1, KeyAttr =>
[]))' >
> delete.txt
>
> And the output was
>
> $VAR1 = {
>           '__a' => [
>                      'b'
>                    ]
>         };
>
> I was aspecting
>
> $VAR1 = {
>           '_a' => [
>                      'b'
>                   ]
>         };
>
> What am I doing wrong?
>

I suspect XML::Simple thinks your XML is not well formed because your
tag names start with an underscore.  See point #2 here:

http://search.cpan.org/~grantm/XML-...mple.pm#Caveats

Which essentially gives it artistic license to do what it wants. Whether
this is a bug or just "you shouldn't do that it is bad for your health"
is hard to say...

In addition on my Perl 5.8.0, XML::Simple 2.0.7 on RH Linux 9, and in
Perl 5.6.1, XML::Simple 2.0.5, on Solaris 8, I get the output you expect.

http://danconia.org

Report this thread to moderator Post Follow-up to this message
Old Post
Wiggins D Anconia
03-27-04 04:14 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PERL Beginners archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 04:55 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.