1247
AI's take on XML (lemmy.world)
submitted 10 months ago by renzev@lemmy.world to c/programmerhumor@lemmy.ml
you are viewing a single comment's thread
view the rest of the comments
[-] ClassifiedPancake@discuss.tchncs.de 3 points 10 months ago* (last edited 10 months ago)

Since XML can have attributes and children, it's not as easy to convert to JSON.

Your JSON example is more akin to:

<address street_address="21 2nd Street" city="New York" ...></address>
[-] CanadaPlus@lemmy.sdf.org 3 points 10 months ago* (last edited 10 months ago)

Hmm, so in tree terms, each node has two distinct types of children, only one of which can have their own children. That sounds more ambiguity-introducing than helpful to me, but that's just a matter of taste. Can you do lists in XML as well?

[-] ClassifiedPancake@discuss.tchncs.de 2 points 10 months ago

No arrays are not allowed. Attributes can only be strings. But the children are kind of an array.

this post was submitted on 08 Sep 2024
1247 points (98.4% liked)

Programmer Humor

37310 readers
73 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 6 years ago
MODERATORS