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.
  • 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
    Marc Clifton
    wrote on last edited by
    #3

    I had the same problem just a couple days ago. I ended up throwing the XML into this[^] and it generated the C# code which worked perfectly and showed me what I was doing wrong. ;)

    Chris Maunder wrote:

    s anyone actively using XML as a data transport format?

    Sadly, yes. Lots of legacy systems or old API's that never got updated to JSON. :(

    Latest Articles:
    Client-Side Type-Based Publisher/Subscriber, Exploring Synchronous, "Event-ed", and Worker Thread Subscriptions

    F OriginalGriffO N S 4 Replies 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
      raddevus
      wrote on last edited by
      #4

      Here's the github project. This Visual Studio project is quite old and there are some weird ideas in there, because generating classes is a bit odd. But, it should all be straight forward --- though ugly code. GitHub - raddevus/XmlClassGenerator: Generates C# classes from XML file. Classes can be pulled into project and mapped so you can serialize your data back to original XML.[^]

      F 1 Reply Last reply
      0
      • M Marc Clifton

        I had the same problem just a couple days ago. I ended up throwing the XML into this[^] and it generated the C# code which worked perfectly and showed me what I was doing wrong. ;)

        Chris Maunder wrote:

        s anyone actively using XML as a data transport format?

        Sadly, yes. Lots of legacy systems or old API's that never got updated to JSON. :(

        Latest Articles:
        Client-Side Type-Based Publisher/Subscriber, Exploring Synchronous, "Event-ed", and Worker Thread Subscriptions

        F Offline
        F Offline
        Forogar
        wrote on last edited by
        #5

        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 1 Reply Last reply
        0
        • R raddevus

          Here's the github project. This Visual Studio project is quite old and there are some weird ideas in there, because generating classes is a bit odd. But, it should all be straight forward --- though ugly code. GitHub - raddevus/XmlClassGenerator: Generates C# classes from XML file. Classes can be pulled into project and mapped so you can serialize your data back to original XML.[^]

          F Offline
          F Offline
          Forogar
          wrote on last edited by
          #6

          It looks pretty good - ReSharper is going nuts on it but who cares!

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

          G 1 Reply Last reply
          0
          • M Marc Clifton

            I had the same problem just a couple days ago. I ended up throwing the XML into this[^] and it generated the C# code which worked perfectly and showed me what I was doing wrong. ;)

            Chris Maunder wrote:

            s anyone actively using XML as a data transport format?

            Sadly, yes. Lots of legacy systems or old API's that never got updated to JSON. :(

            Latest Articles:
            Client-Side Type-Based Publisher/Subscriber, Exploring Synchronous, "Event-ed", and Worker Thread Subscriptions

            OriginalGriffO Offline
            OriginalGriffO Offline
            OriginalGriff
            wrote on last edited by
            #7

            Thanks for that - I use these for JSON, but I've not had an XML version before: JSON Utils: Generate C#, VB.Net, SQL Table, Java and PHP from JSON[^] Convert JSON to C# Classes Online - Json2CSharp Toolkit[^] Mostly because I'm not fond of XML ... come to think of it, I'm not fond of HTML either. :-D

            "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt AntiTwitter: @DalekDave is now a follower!

            "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
            "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

            1 Reply Last reply
            0
            • M Marc Clifton

              I had the same problem just a couple days ago. I ended up throwing the XML into this[^] and it generated the C# code which worked perfectly and showed me what I was doing wrong. ;)

              Chris Maunder wrote:

              s anyone actively using XML as a data transport format?

              Sadly, yes. Lots of legacy systems or old API's that never got updated to JSON. :(

              Latest Articles:
              Client-Side Type-Based Publisher/Subscriber, Exploring Synchronous, "Event-ed", and Worker Thread Subscriptions

              N Offline
              N Offline
              Nelek
              wrote on last edited by
              #8

              THANK YOU A LOT :thumbsup::thumbsup::thumbsup:

              M.D.V. ;) If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about? Help me to understand what I'm saying, and I'll explain it better to you Rating helpful answers is nice, but saying thanks can be even nicer.

              1 Reply Last reply
              0
              • F Forogar

                It looks pretty good - ReSharper is going nuts on it but who cares!

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

                G Offline
                G Offline
                glennPattonWork3
                wrote on last edited by
                #9

                Dang, what did Raddius say or do, he is trusted member of :bob:'s court.

                S R 2 Replies 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

                  G Offline
                  G Offline
                  Gary R Wheeler
                  wrote on last edited by
                  #10

                  I've found that .NET XML serialization works fine and is relatively simple as long as .NET is doing the round-tripping. I've occasionally had to write my own serializers, but that's usually fairly trivial. Adapting it to an existing schema or otherwise-specified form is a PITA. Instead of being able to say "handle this in XML", you essentially have to write code that implements the schema. This of course sucks, because the schema changes all the time (trust me, it's in the rules). You only get basic parsing out of the .NET XML support if you go this route.

                  Software Zen: delete this;

                  1 Reply Last reply
                  0
                  • M Marc Clifton

                    I had the same problem just a couple days ago. I ended up throwing the XML into this[^] and it generated the C# code which worked perfectly and showed me what I was doing wrong. ;)

                    Chris Maunder wrote:

                    s anyone actively using XML as a data transport format?

                    Sadly, yes. Lots of legacy systems or old API's that never got updated to JSON. :(

                    Latest Articles:
                    Client-Side Type-Based Publisher/Subscriber, Exploring Synchronous, "Event-ed", and Worker Thread Subscriptions

                    S Offline
                    S Offline
                    Slacker007
                    wrote on last edited by
                    #11

                    Marc Clifton wrote:

                    Lots of legacy systems or old API's that never got updated to JSON.

                    Exactly.

                    1 Reply Last reply
                    0
                    • G glennPattonWork3

                      Dang, what did Raddius say or do, he is trusted member of :bob:'s court.

                      S Offline
                      S Offline
                      Slacker007
                      wrote on last edited by
                      #12

                      perhaps he tried to delete the post, and the system made the message closed because others responded? I thought it weird as well.

                      1 Reply Last reply
                      0
                      • G glennPattonWork3

                        Dang, what did Raddius say or do, he is trusted member of :bob:'s court.

                        R Offline
                        R Offline
                        Rick York
                        wrote on last edited by
                        #13

                        It appears he posted a link to something that is verbotten.

                        "They have a consciousness, they have a life, they have a soul! Damn you! Let the rabbits wear glasses! Save our brothers! Can I get an amen?"

                        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
                          realJSOP
                          wrote on last edited by
                          #14

                          This article may help: Rudimentary ViewModel Class Generator[^] It deals specifically with entities from xml

                          ".45 ACP - because shooting twice is just silly" - JSOP, 2010
                          -----
                          You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
                          -----
                          When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013

                          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

                            F Offline
                            F Offline
                            fd9750
                            wrote on last edited by
                            #15

                            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 !!!

                            C U T 3 Replies 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 !!!

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

                              That's what killed me: I have a working implementation in Json but needed (evidently) to have it work in XML too. Json: it just worked. Next? XML: my life is a miserable series of pointless failures

                              cheers Chris Maunder

                              T 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

                                K Offline
                                K Offline
                                KarstenK
                                wrote on last edited by
                                #17

                                The XML-hype is history. try json it is smaller, better readable and a lot of parsers can handle it.

                                Press F1 for help or google it. Greetings from Germany

                                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

                                  Greg UtasG Offline
                                  Greg UtasG Offline
                                  Greg Utas
                                  wrote on last edited by
                                  #18

                                  I never had to suffer through this kind of pain. I mostly worked on a system that was originally developed when memory and CPU time couldn't be frittered away on messages the size of _.jpg_s. Our proprietary language prefixed pack(n) to the type to control a field's width, and it was easy to predict how it would lay out a struct. Developing everything in the same language and standardizing on endianism made it possible to read/write structs directly from/to messages that used TLV encoding (type=parameter id, length=bytes, value=struct, nested if necessary). Very efficient, and no serialization or deserialization. But processors were upgraded independently, so an interprocessor protocol had to remain backward compatible. In rare cases, this meant that an adapter in release n+k had to convert a message received from a processor still running release n.

                                  Robust Services Core | Software Techniques for Lemmings | Articles
                                  The fox knows many things, but the hedgehog knows one big thing.

                                  <p><a href="https://github.com/GregUtas/robust-services-core/blob/master/README.md">Robust Services Core</a>
                                  <em>The fox knows many things, but the hedgehog knows one big thing.</em></p>

                                  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

                                    K Offline
                                    K Offline
                                    kmoorevs
                                    wrote on last edited by
                                    #19

                                    Chris Maunder wrote:

                                    Is anyone actively using XML as a data transport format?

                                    Gosh yes, in a number of ways: 0: storing encrypted ftp credentials for desktop apps (yep, right out in the open on a web server) they get changed annually or as needed. 1: advertising program updates for desktop apps 2: uploading client data from desktop apps to a ftp/web server for processing, then maybe reporting 3: downloading client data from web apps to desktop apps (sql server 'for xml' is great) the xml loads directly into a datatable...life is good. Of course, it helps when you control both ends (creation and consumption) of the xml content. :)

                                    "Go forth into the source" - Neal Morse "Hope is contagious"

                                    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

                                      T Offline
                                      T Offline
                                      trønderen
                                      wrote on last edited by
                                      #20

                                      I see XML (and even more: HTML) as a binary format. Not suitable for human consumption. XML is OK for something generated as a binary serialization, untouched by human hands. Evaluated as such, XML qualities are mediocre. I cannot imagine any binary Tag-Length-Value format worse than XML, by any standard. XML has a single force: You can edit it using vi! (Or for that sake: cat 0 > filename :-)) Not too long ago, I asked (in General Programming) for reactions to my proposal of have a friend of mine provide a lot of tabular data as Excel tables, rather than vi editable files. That was more or less universally condemned: Either, he should provide data as a vi editable text file - in the class of XML, CSV, YAML, JSON ... - or I should develop a tailor-made domain-specific data entry application, doing a complete validation of all input data. Thinking that an Excel sheet might contribute to validation, whatever checks were added, was just naive and worthless. I accept the arguments for a data entry application, as long as we recognize that text based binary formats such as XML, CSV, YAML, and JSON, are unfit for human consumption. They are binary: You have to be concerned about the representation, with regard to use of special characters, quoting, length restrictions, ... The contents isn't free. So, let's make data entry applications that are free. How easy is that, with XML, CSV, YAML or JSON as the user level data entry format? Once we have come that far: Why not use a truly binary format, most likely TLV based? If you admit that the user should never edit the file directly, neither with vi nor cat 0 > file, what is then the advantage of using XML, HTML, CSV, YAML, JSON, ... ? If anyone insists on obtaining the information in an "editable" format, generating it from a binary TLV representation is usually quite trivial. For the applications I manage, I can easily provide stored information in either "editable" format, or even (to some degree) accept input in those formats. Yet, any "editable" format is secondary. Simple tree structures, those that you can easily edit using vi (or cat 0 > filename) are easily handled, but if the data structures require cross-linking, you may need to use a some domain dependent data entry (or data manipulation) tool. You just can't handle complex structures neither in XML, YAML nor JSON; they have to be managed with specialized tools. The essential point for this discussion: XML, as well as other "editable" formats, is

                                      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
                                        Mycroft Holmes
                                        wrote on last edited by
                                        #21

                                        many years ago my boss dictated that xml will be the transport format for the bank. Once you hit multi million complex records xml choked the server so that was one failed project (of many). We then converted back to csv.

                                        Never underestimate the power of human stupidity - RAH I'm old. I know stuff - JSOP

                                        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

                                          H Offline
                                          H Offline
                                          hevisko
                                          wrote on last edited by
                                          #22

                                          Chris Maunder wrote:

                                          Is anyone actively using XML as a data transport format?

                                          Jabber does. and it's run over LOW BANDWIDTH networks too ;)

                                          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