Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

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

by choroba (Archbishop)
on May 27, 2021 at 09:49 UTC ( #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 (Priest) 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? | Other CB clients
Other Users?
Others meditating upon the Monastery: (4)
As of 2022-05-28 23:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you prefer to work remotely?



    Results (101 votes). Check out past polls.

    Notices?