There exists a peculiar amnesia in software engineering regarding XML. Mention it in most circles and you will receive knowing smiles, dismissive waves, the sort of patronizing acknowledgment reserved for technologies deemed passé. “Oh, XML,” they say, as if the very syllables carry the weight of obsolescence. “We use JSON now. Much cleaner.”

    • Kissaki@programming.devOP
      link
      fedilink
      English
      arrow-up
      6
      arrow-down
      1
      ·
      10 months ago

      In XML the practice to approximate arrays is to put the index as an attribute. It’s incredibly gross.

      I don’t think I’ve seen that much if ever.

      Typically, XML repeats tag names. Repeating keys are not possible in JSON, but are possible in XML.

      <items>
        <item></item>
        <item></item>
        <item></item>
      </items>
      
            • Kissaki@programming.devOP
              link
              fedilink
              English
              arrow-up
              1
              ·
              10 months ago

              If the XML parser parses into an ordered representation (the XML information set), isn’t it then the deserializer’s choice how they map that to the programming language/type system they are deserializing to? So in a system with ordered arrays it would likely map to those?

              If XML can be written in an ordered way, and the parsed XML information set has ordered children for those, I still don’t see where order gets lost or is impossible [to guarantee] in XML.