Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re^3: XML::Simple and ISO-8859-1 encoding buggy?

by choroba (Cardinal)
on May 27, 2021 at 09:49 UTC ( [id://11133117]=note: print w/replies, xml ) Need Help??


in reply to Re^2: XML::Simple and ISO-8859-1 encoding buggy?
in thread XML::Simple and ISO-8859-1 encoding buggy?

> Basically the equivalent of simplicity to parsing a JSON file.

The problem is the DOM tree of XML doesn't correspond 1:1 to common data structures (scalars, arrays, hashes).

<r ch="1"> <ch>2</ch> <ch>3</ch> <!-- <ch>4</ch> --> </r>
What data structure do you expect?

map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]

Replies are listed 'Best First'.
Re^4: XML::Simple and ISO-8859-1 encoding buggy?
by cavac (Parson) on May 27, 2021 at 11:41 UTC

    I expect that all of the "ch" elements in this tag will be put into an array. But what i really expect is that the XML doesn't come with such a stupid and confusing design in the first place. I can't see a semantic reason for this type of XML design. If someone sends me a design like this and does not have a very, very, very good explanation and a very solid reason behind this, i will just refuse to accept that design.

    Just because something is possible does not mean it is acceptable. Like using obfuscation in production code.

    perl -e 'use Crypt::Digest::SHA256 qw[sha256_hex]; print substr(sha256_hex("the Answer To Life, The Universe And Everything"), 6, 2), "\n";'

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11133117]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (3)
As of 2024-04-24 04:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found