Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. Why is XML?

Why is XML?

Scheduled Pinned Locked Moved The Lounge
xmlcsharphtmlasp-netdatabase
69 Posts 49 Posters 18 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Forogar

    oooh! That is SO useful - thanks for the link, Marc!

    - I would love to change the world, but they won’t give me the source code.

    A Offline
    A Offline
    Alex C Duma
    wrote on last edited by
    #31

    I think there is a feature in VS: Paste JSON and XML as a Class -- Visual Studio Magazine[^]

    Alex C. D.

    1 Reply Last reply
    0
    • F fd9750

      Some guy somewhere had a bad dream and woke up with the idea: now how can I make something totally confusing and complicated which computers can read effortlessly but humans will find totally incomprehensible? He came up with XML and ticked all the necessary boxes/requirements perfectly. Personally I am not a fan of javascript but boy did they get that JSON stuff right. Whatever programming language you care to use the JSON data exchange is dead easy to follow and debug. Leave the hard interpreting stuff to computers, not humans. For god's sake: that is why we designed them for !!!

      U Offline
      U Offline
      User 4243366
      wrote on last edited by
      #32

      I use XML all the time with LINQ in C#. It's easy and simple.

      "I used to write COBOL, now I can do anything..."

      1 Reply Last reply
      0
      • U User 10331519

        Maybe I’m biased because I’ve been working with XML since it was invented, but I love it. My experience with it predates object serializers and whatnot, and I still find it simpler to roll my own much of the time to ensure that the output properly expresses the object’s purpose and usage. I use JSON for transport where appropriate, such as pulling data into a Vue app, but whenever I need to model data in JSON, I quickly lose patience. The absence of a named root node, namespaces, and attributes leads to a pretty weak representation of the facts that does a poor job of conveying the designer’s intent. Some have argued on this thread that XML is a binary format and not for human consumption, but I would much rather be given some XML to interpret than a bunch of JSON if I am tasked with querying the data. And a named end tag is pretty handy; not a fan of counting curly brackets! Of course, XML is supported by a suite of very mature standardized tools, the likes of which simply don’t exist in the JSON world yet.

        Cheers, Keith

        C Offline
        C Offline
        Chris Maunder
        wrote on last edited by
        #33

        The ability to describe, and not just store, your data and abide by a published schema while remaining flexible and easily transformable and human readable is definitely a wonderful thing. I will give you that.

        cheers Chris Maunder

        1 Reply Last reply
        0
        • C Chris Maunder

          Just why. I spent an hour fighting with XmlSerialisers to try and get my object mapped to a schema. Changing names, trying to get attributes setup, dealing with CDATA. I gave up. I got so fed up I simply wrote the XML directly as a raw string. If I could have kicked it I would have kicked it. I totally get the beauty of having data in a class and throwing it at different serialisers and having it Just Work. Switch between XML and Json and maybe binary and text and build out this whole massive ecosystem that screams "I'm trying to do too much!". But dear lord. It's like root canal surgery. Is anyone actively using XML as a data transport format? I get that we all use it in things like XAML and ASP.NET pages and the whole HTML thing, but as something that is not seen or edited by humans, that needs to be cognizant of bandwidth, is it still being used in that manner or am I just really, really intolerant this morning?

          cheers Chris Maunder

          S Offline
          S Offline
          Steve Naidamast
          wrote on last edited by
          #34

          Comma delimited data is just so much easier without all the fuss. It is also more efficient...

          Steve Naidamast Sr. Software Engineer Black Falcon Software, Inc. blackfalconsoftware@outlook.com

          J 1 Reply Last reply
          0
          • C Chris Maunder

            Just why. I spent an hour fighting with XmlSerialisers to try and get my object mapped to a schema. Changing names, trying to get attributes setup, dealing with CDATA. I gave up. I got so fed up I simply wrote the XML directly as a raw string. If I could have kicked it I would have kicked it. I totally get the beauty of having data in a class and throwing it at different serialisers and having it Just Work. Switch between XML and Json and maybe binary and text and build out this whole massive ecosystem that screams "I'm trying to do too much!". But dear lord. It's like root canal surgery. Is anyone actively using XML as a data transport format? I get that we all use it in things like XAML and ASP.NET pages and the whole HTML thing, but as something that is not seen or edited by humans, that needs to be cognizant of bandwidth, is it still being used in that manner or am I just really, really intolerant this morning?

            cheers Chris Maunder

            S Offline
            S Offline
            Sr_Dogmeat
            wrote on last edited by
            #35

            I use it all the time, but I also always describe my message formats in XSD. That is the easiest way to get the code generators on all platforms to properly parse one’s messages.

            1 Reply Last reply
            0
            • S Steve Naidamast

              Comma delimited data is just so much easier without all the fuss. It is also more efficient...

              Steve Naidamast Sr. Software Engineer Black Falcon Software, Inc. blackfalconsoftware@outlook.com

              J Offline
              J Offline
              Joseph T Adams
              wrote on last edited by
              #36

              For some kinds of very simple data, some dialect of CSV may be ok. But in 3 decades of software development I've rarely found it it be an adequate solution, much less the optimal one.

              S 1 Reply Last reply
              0
              • U User 10331519

                Maybe I’m biased because I’ve been working with XML since it was invented, but I love it. My experience with it predates object serializers and whatnot, and I still find it simpler to roll my own much of the time to ensure that the output properly expresses the object’s purpose and usage. I use JSON for transport where appropriate, such as pulling data into a Vue app, but whenever I need to model data in JSON, I quickly lose patience. The absence of a named root node, namespaces, and attributes leads to a pretty weak representation of the facts that does a poor job of conveying the designer’s intent. Some have argued on this thread that XML is a binary format and not for human consumption, but I would much rather be given some XML to interpret than a bunch of JSON if I am tasked with querying the data. And a named end tag is pretty handy; not a fan of counting curly brackets! Of course, XML is supported by a suite of very mature standardized tools, the likes of which simply don’t exist in the JSON world yet.

                Cheers, Keith

                S Offline
                S Offline
                Sr_Dogmeat
                wrote on last edited by
                #37

                Your points are spot on. XSD is the best data description language I have encountered. I use XML Spy to create my schemas and then everything under the sun can read the schema and produce working code that is schema compliant. I was really disappointed with JSON schema, one would think they would have plagiarized from xml schema but no... perhaps the people that like JSON are dealing with flat or very limited hierarchies? Perhaps the are lacking variant nodes (choice). And perhaps they do not have to deal with patterns in strings for legacy systems?

                1 Reply Last reply
                0
                • C Chris Maunder

                  Just why. I spent an hour fighting with XmlSerialisers to try and get my object mapped to a schema. Changing names, trying to get attributes setup, dealing with CDATA. I gave up. I got so fed up I simply wrote the XML directly as a raw string. If I could have kicked it I would have kicked it. I totally get the beauty of having data in a class and throwing it at different serialisers and having it Just Work. Switch between XML and Json and maybe binary and text and build out this whole massive ecosystem that screams "I'm trying to do too much!". But dear lord. It's like root canal surgery. Is anyone actively using XML as a data transport format? I get that we all use it in things like XAML and ASP.NET pages and the whole HTML thing, but as something that is not seen or edited by humans, that needs to be cognizant of bandwidth, is it still being used in that manner or am I just really, really intolerant this morning?

                  cheers Chris Maunder

                  D Offline
                  D Offline
                  dandy72
                  wrote on last edited by
                  #38

                  Chris Maunder wrote:

                  as something that is not seen or edited by humans

                  I could've sworn when I first started reading about XML, it was being sold based on the idea that it was trivially easy for people to read and write.

                  C 1 Reply Last reply
                  0
                  • C Chris Maunder

                    Just why. I spent an hour fighting with XmlSerialisers to try and get my object mapped to a schema. Changing names, trying to get attributes setup, dealing with CDATA. I gave up. I got so fed up I simply wrote the XML directly as a raw string. If I could have kicked it I would have kicked it. I totally get the beauty of having data in a class and throwing it at different serialisers and having it Just Work. Switch between XML and Json and maybe binary and text and build out this whole massive ecosystem that screams "I'm trying to do too much!". But dear lord. It's like root canal surgery. Is anyone actively using XML as a data transport format? I get that we all use it in things like XAML and ASP.NET pages and the whole HTML thing, but as something that is not seen or edited by humans, that needs to be cognizant of bandwidth, is it still being used in that manner or am I just really, really intolerant this morning?

                    cheers Chris Maunder

                    D Offline
                    D Offline
                    davercadman
                    wrote on last edited by
                    #39

                    My favorite part is when the schema doesn't work. XML - Another solution in search of a problem.

                    1 Reply Last reply
                    0
                    • J Joseph T Adams

                      For some kinds of very simple data, some dialect of CSV may be ok. But in 3 decades of software development I've rarely found it it be an adequate solution, much less the optimal one.

                      S Offline
                      S Offline
                      Steve Naidamast
                      wrote on last edited by
                      #40

                      I retired after 4 decades in software engineering in 2014. Though I used XML extensively during my career, I found it more of a nuisance than anything else. XML and JSON merely serve to add layers of software to handle the formats, making them both rather inefficient. And both are text-based. Similarly comma-delimited data is text based as well without all of the extra meta-data and when encrypted would produce smaller files or data-packets for transmission. For most situations, one can use comma-delimited data in the same ways as XML with a little ingenuity and without all the extra meta-data.

                      Steve Naidamast Sr. Software Engineer Black Falcon Software, Inc. blackfalconsoftware@outlook.com

                      J 1 Reply Last reply
                      0
                      • C Chris Maunder

                        Just why. I spent an hour fighting with XmlSerialisers to try and get my object mapped to a schema. Changing names, trying to get attributes setup, dealing with CDATA. I gave up. I got so fed up I simply wrote the XML directly as a raw string. If I could have kicked it I would have kicked it. I totally get the beauty of having data in a class and throwing it at different serialisers and having it Just Work. Switch between XML and Json and maybe binary and text and build out this whole massive ecosystem that screams "I'm trying to do too much!". But dear lord. It's like root canal surgery. Is anyone actively using XML as a data transport format? I get that we all use it in things like XAML and ASP.NET pages and the whole HTML thing, but as something that is not seen or edited by humans, that needs to be cognizant of bandwidth, is it still being used in that manner or am I just really, really intolerant this morning?

                        cheers Chris Maunder

                        M Offline
                        M Offline
                        michaelbarb
                        wrote on last edited by
                        #41

                        My professor said that XML exists because Microsoft was afraid of being sued because JSON was to much like Java. Kid of like the same reason that C# exists. I think he was being sarcastic but am not totally sure. He did show that history of the two and which came first is debatable. Both have roots that run back a long, long time ago.

                        So many years of programming I have forgotten more languages than I know.

                        C D T 3 Replies Last reply
                        0
                        • S Steve Naidamast

                          I retired after 4 decades in software engineering in 2014. Though I used XML extensively during my career, I found it more of a nuisance than anything else. XML and JSON merely serve to add layers of software to handle the formats, making them both rather inefficient. And both are text-based. Similarly comma-delimited data is text based as well without all of the extra meta-data and when encrypted would produce smaller files or data-packets for transmission. For most situations, one can use comma-delimited data in the same ways as XML with a little ingenuity and without all the extra meta-data.

                          Steve Naidamast Sr. Software Engineer Black Falcon Software, Inc. blackfalconsoftware@outlook.com

                          J Offline
                          J Offline
                          Joseph T Adams
                          wrote on last edited by
                          #42

                          Well, the metadata is something I find incredibly useful, and this is also why I tend to prefer XML over JSON as well when I need a robust way to transfer data of more than trivial complexity.

                          1 Reply Last reply
                          0
                          • C Chris Maunder

                            Just why. I spent an hour fighting with XmlSerialisers to try and get my object mapped to a schema. Changing names, trying to get attributes setup, dealing with CDATA. I gave up. I got so fed up I simply wrote the XML directly as a raw string. If I could have kicked it I would have kicked it. I totally get the beauty of having data in a class and throwing it at different serialisers and having it Just Work. Switch between XML and Json and maybe binary and text and build out this whole massive ecosystem that screams "I'm trying to do too much!". But dear lord. It's like root canal surgery. Is anyone actively using XML as a data transport format? I get that we all use it in things like XAML and ASP.NET pages and the whole HTML thing, but as something that is not seen or edited by humans, that needs to be cognizant of bandwidth, is it still being used in that manner or am I just really, really intolerant this morning?

                            cheers Chris Maunder

                            D Offline
                            D Offline
                            DumpsterJuice
                            wrote on last edited by
                            #43

                            I always hated working with XML. JSON is a god send. I had to serialize from JSON to XML for a file upload. It was mandated that way.. not my choice. Anyway I now have an XML Serializer that is stupid simple to use. Keep It Simple, keep it moving.

                            1 Reply Last reply
                            0
                            • C Chris Maunder

                              Just why. I spent an hour fighting with XmlSerialisers to try and get my object mapped to a schema. Changing names, trying to get attributes setup, dealing with CDATA. I gave up. I got so fed up I simply wrote the XML directly as a raw string. If I could have kicked it I would have kicked it. I totally get the beauty of having data in a class and throwing it at different serialisers and having it Just Work. Switch between XML and Json and maybe binary and text and build out this whole massive ecosystem that screams "I'm trying to do too much!". But dear lord. It's like root canal surgery. Is anyone actively using XML as a data transport format? I get that we all use it in things like XAML and ASP.NET pages and the whole HTML thing, but as something that is not seen or edited by humans, that needs to be cognizant of bandwidth, is it still being used in that manner or am I just really, really intolerant this morning?

                              cheers Chris Maunder

                              R Offline
                              R Offline
                              rhyous
                              wrote on last edited by
                              #44

                              Xml wasn't originally written for web service data transfer or serialization/deserialization. It was written by the W3c to replace Html but still be Html-like. Xml is a Mark-up language, hence it has mark-up. Mark-up makes it good for readability by humans but also a standard readable by machines. Xml was then hi-jacked to be used by SOAP web services with serialization/deserialization. Then someone realized that json was better for serialization/deserialization, especially since readability by both humans and machines wasn't necessary, it only needs to be read by machines. JSON also has room for improvement in verbosity and as soon as a good replacement exists, people will say the same things: why json when new-thing is better.

                              C 1 Reply Last reply
                              0
                              • C Chris Maunder

                                Just why. I spent an hour fighting with XmlSerialisers to try and get my object mapped to a schema. Changing names, trying to get attributes setup, dealing with CDATA. I gave up. I got so fed up I simply wrote the XML directly as a raw string. If I could have kicked it I would have kicked it. I totally get the beauty of having data in a class and throwing it at different serialisers and having it Just Work. Switch between XML and Json and maybe binary and text and build out this whole massive ecosystem that screams "I'm trying to do too much!". But dear lord. It's like root canal surgery. Is anyone actively using XML as a data transport format? I get that we all use it in things like XAML and ASP.NET pages and the whole HTML thing, but as something that is not seen or edited by humans, that needs to be cognizant of bandwidth, is it still being used in that manner or am I just really, really intolerant this morning?

                                cheers Chris Maunder

                                B Offline
                                B Offline
                                Bruce Patin
                                wrote on last edited by
                                #45

                                I've had to generate a file from a database, but the built-in methods didn't work for me, so I also just constructed it all by adding to a string.

                                1 Reply Last reply
                                0
                                • M michaelbarb

                                  My professor said that XML exists because Microsoft was afraid of being sued because JSON was to much like Java. Kid of like the same reason that C# exists. I think he was being sarcastic but am not totally sure. He did show that history of the two and which came first is debatable. Both have roots that run back a long, long time ago.

                                  So many years of programming I have forgotten more languages than I know.

                                  C Offline
                                  C Offline
                                  Chris Maunder
                                  wrote on last edited by
                                  #46

                                  Every big company is afraid of being sued, but I doubt that's the reason. Microsoft would more likely choose a competing solution in order to lock out a competitor. The story doesn't seem "right" but who knows. The Microsoft of today is a very, very different company than the Microsoft of 2000. (and it makes them better and worse)

                                  cheers Chris Maunder

                                  1 Reply Last reply
                                  0
                                  • D dandy72

                                    Chris Maunder wrote:

                                    as something that is not seen or edited by humans

                                    I could've sworn when I first started reading about XML, it was being sold based on the idea that it was trivially easy for people to read and write.

                                    C Offline
                                    C Offline
                                    Chris Maunder
                                    wrote on last edited by
                                    #47

                                    Ah, marketing...

                                    cheers Chris Maunder

                                    D 1 Reply Last reply
                                    0
                                    • C Chris Maunder

                                      Just why. I spent an hour fighting with XmlSerialisers to try and get my object mapped to a schema. Changing names, trying to get attributes setup, dealing with CDATA. I gave up. I got so fed up I simply wrote the XML directly as a raw string. If I could have kicked it I would have kicked it. I totally get the beauty of having data in a class and throwing it at different serialisers and having it Just Work. Switch between XML and Json and maybe binary and text and build out this whole massive ecosystem that screams "I'm trying to do too much!". But dear lord. It's like root canal surgery. Is anyone actively using XML as a data transport format? I get that we all use it in things like XAML and ASP.NET pages and the whole HTML thing, but as something that is not seen or edited by humans, that needs to be cognizant of bandwidth, is it still being used in that manner or am I just really, really intolerant this morning?

                                      cheers Chris Maunder

                                      P Offline
                                      P Offline
                                      Peter Adam
                                      wrote on last edited by
                                      #48

                                      Hungary's National Tax and Customs Agency requires real-time XML invoice reporting[^] , so we do it. It requires the schema designer to know his/her art, because xsd.exe[^] can choke on

                                      and

                                      type brainless design. Other pain was that while the XML standard is happy with a default namespace, XPath requires a prefix[^].

                                      1 Reply Last reply
                                      0
                                      • R rhyous

                                        Xml wasn't originally written for web service data transfer or serialization/deserialization. It was written by the W3c to replace Html but still be Html-like. Xml is a Mark-up language, hence it has mark-up. Mark-up makes it good for readability by humans but also a standard readable by machines. Xml was then hi-jacked to be used by SOAP web services with serialization/deserialization. Then someone realized that json was better for serialization/deserialization, especially since readability by both humans and machines wasn't necessary, it only needs to be read by machines. JSON also has room for improvement in verbosity and as soon as a good replacement exists, people will say the same things: why json when new-thing is better.

                                        C Offline
                                        C Offline
                                        Chris Maunder
                                        wrote on last edited by
                                        #49

                                        That brought back XHTML nightmares...

                                        cheers Chris Maunder

                                        1 Reply Last reply
                                        0
                                        • C Chris Maunder

                                          Ah, marketing...

                                          cheers Chris Maunder

                                          D Offline
                                          D Offline
                                          dandy72
                                          wrote on last edited by
                                          #50

                                          Chris Maunder wrote:

                                          Ah AAARGH! marketing...

                                          FTFY.

                                          1 Reply Last reply
                                          0
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          • Login

                                          • Don't have an account? Register

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • World
                                          • Users
                                          • Groups