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. Do people still use XML?

Do people still use XML?

Scheduled Pinned Locked Moved The Lounge
dockerdata-structuresxmljsonquestion
46 Posts 15 Posters 0 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.
  • H Offline
    H Offline
    honey the codewitch
    wrote on last edited by
    #1

    I can't use JSON for rendering a parse tree because JSON does not preserve the order of subelements and because of the way multiple values are presented it gives json problems. XML can do it, because XML preserves element order and an element can be present more than once within its parent container. But I don't want to bother if everyone hates XML. What would you do?

    When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.

    Kornfeld Eliyahu PeterK L R abmvA N 15 Replies Last reply
    0
    • H honey the codewitch

      I can't use JSON for rendering a parse tree because JSON does not preserve the order of subelements and because of the way multiple values are presented it gives json problems. XML can do it, because XML preserves element order and an element can be present more than once within its parent container. But I don't want to bother if everyone hates XML. What would you do?

      When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.

      Kornfeld Eliyahu PeterK Offline
      Kornfeld Eliyahu PeterK Offline
      Kornfeld Eliyahu Peter
      wrote on last edited by
      #2

      If XML is what you need use XML! See your options and pick the best (optionally the 2 or 3 of them) and use it... Neither JSON nor XML is rocket science... If using XML, just remember to provide a working schema...

      "The greatest enemy of knowledge is not ignorance, it is the illusion of knowledge". Stephen Hawking, 1942- 2018

      "It never ceases to amaze me that a spacecraft launched in 1977 can be fixed remotely from Earth." ― Brian Cox

      H 1 Reply Last reply
      0
      • H honey the codewitch

        I can't use JSON for rendering a parse tree because JSON does not preserve the order of subelements and because of the way multiple values are presented it gives json problems. XML can do it, because XML preserves element order and an element can be present more than once within its parent container. But I don't want to bother if everyone hates XML. What would you do?

        When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        When would you ever want a parse tree as a string? Actually when would you want a parse tree at all, instead of building some more convenient (and garbage-free) representation immediately?

        H 2 Replies Last reply
        0
        • H honey the codewitch

          I can't use JSON for rendering a parse tree because JSON does not preserve the order of subelements and because of the way multiple values are presented it gives json problems. XML can do it, because XML preserves element order and an element can be present more than once within its parent container. But I don't want to bother if everyone hates XML. What would you do?

          When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.

          R Offline
          R Offline
          RickZeeland
          wrote on last edited by
          #4

          To me the advantage of using XML with Visual Studio is that all functionality is built-in, when using an external library like the Newtonsoft.Json.dll you can get in DLL hell. Especially when using NuGet packages everybody seems to be using their own version of Newtonsoft.Json.dll :mad: Here is an Ebook about XML: https://bookdl.com/978-1484231043/[^]

          1 Reply Last reply
          0
          • H honey the codewitch

            I can't use JSON for rendering a parse tree because JSON does not preserve the order of subelements and because of the way multiple values are presented it gives json problems. XML can do it, because XML preserves element order and an element can be present more than once within its parent container. But I don't want to bother if everyone hates XML. What would you do?

            When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.

            abmvA Offline
            abmvA Offline
            abmv
            wrote on last edited by
            #5

            You are assuming that everyone hates XML. XML/XSLT and the API around it are mature in Java and .NET, and many systems were build based on these technologies.

            Caveat Emptor. "Progress doesn't come from early risers – progress is made by lazy men looking for easier ways to do things." Lazarus Long

            We are in the beginning of a mass extinction. - Greta Thunberg

            H 1 Reply Last reply
            0
            • abmvA abmv

              You are assuming that everyone hates XML. XML/XSLT and the API around it are mature in Java and .NET, and many systems were build based on these technologies.

              Caveat Emptor. "Progress doesn't come from early risers – progress is made by lazy men looking for easier ways to do things." Lazarus Long

              H Offline
              H Offline
              honey the codewitch
              wrote on last edited by
              #6

              I think you misunderstood me. I didn't say everyone hates XML. I only suggested it as a possibility (now that JSON is around)

              When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.

              1 Reply Last reply
              0
              • L Lost User

                When would you ever want a parse tree as a string? Actually when would you want a parse tree at all, instead of building some more convenient (and garbage-free) representation immediately?

                H Offline
                H Offline
                honey the codewitch
                wrote on last edited by
                #7

                The way my parser works you can practically shape the parse tree however you want. Plus you can hard type the values from the lexer - even with your own types. So you basically get an AST straight from the parser. Spitting to JSON just gives you a tree structure you can pass around as JSON

                When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.

                1 Reply Last reply
                0
                • Kornfeld Eliyahu PeterK Kornfeld Eliyahu Peter

                  If XML is what you need use XML! See your options and pick the best (optionally the 2 or 3 of them) and use it... Neither JSON nor XML is rocket science... If using XML, just remember to provide a working schema...

                  "The greatest enemy of knowledge is not ignorance, it is the illusion of knowledge". Stephen Hawking, 1942- 2018

                  H Offline
                  H Offline
                  honey the codewitch
                  wrote on last edited by
                  #8

                  There can be no schema for these ones. Or rather, the schema is in EBNF, not XmlSchema/XSD It's by design. This is a parse tree. The elements are going to be different depending on the input grammar. For any input grammar, you should define one XSD to go with it.

                  When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.

                  Kornfeld Eliyahu PeterK 1 Reply Last reply
                  0
                  • L Lost User

                    When would you ever want a parse tree as a string? Actually when would you want a parse tree at all, instead of building some more convenient (and garbage-free) representation immediately?

                    H Offline
                    H Offline
                    honey the codewitch
                    wrote on last edited by
                    #9

                    I think I misread you at first so let me try this again. I don't want to parse any strings. I created a tool that allows others to generate parsers to parse strings. As to why you would want to - most of the internet runs on text based protocols. XML and JSON are text based, as are most internet data exchange formats. Also there are things like programming languages. Say you want to parse one, or create your own. This helps with that, or making a query engine, making a SQL DB of your own, or parse SQL scripts whatever. There are plenty of reasons to use a parser.

                    When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.

                    L 1 Reply Last reply
                    0
                    • H honey the codewitch

                      There can be no schema for these ones. Or rather, the schema is in EBNF, not XmlSchema/XSD It's by design. This is a parse tree. The elements are going to be different depending on the input grammar. For any input grammar, you should define one XSD to go with it.

                      When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.

                      Kornfeld Eliyahu PeterK Offline
                      Kornfeld Eliyahu PeterK Offline
                      Kornfeld Eliyahu Peter
                      wrote on last edited by
                      #10

                      Maybe (however as EBNF is finite, and it makes the input finite, which makes outpute finite), but you can create XML schema for every grammar the same way/time you parse it... It should not be that hard...

                      "The greatest enemy of knowledge is not ignorance, it is the illusion of knowledge". Stephen Hawking, 1942- 2018

                      "It never ceases to amaze me that a spacecraft launched in 1977 can be fixed remotely from Earth." ― Brian Cox

                      H 1 Reply Last reply
                      0
                      • H honey the codewitch

                        I think I misread you at first so let me try this again. I don't want to parse any strings. I created a tool that allows others to generate parsers to parse strings. As to why you would want to - most of the internet runs on text based protocols. XML and JSON are text based, as are most internet data exchange formats. Also there are things like programming languages. Say you want to parse one, or create your own. This helps with that, or making a query engine, making a SQL DB of your own, or parse SQL scripts whatever. There are plenty of reasons to use a parser.

                        When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.

                        L Offline
                        L Offline
                        Lost User
                        wrote on last edited by
                        #11

                        I know what a parser is, obviously. But if the output of the parser is a string (such as XML or JSON), then you're building some Rube Goldberg machine that keeps parsing and serializing and parsing again.

                        H 1 Reply Last reply
                        0
                        • L Lost User

                          I know what a parser is, obviously. But if the output of the parser is a string (such as XML or JSON), then you're building some Rube Goldberg machine that keeps parsing and serializing and parsing again.

                          H Offline
                          H Offline
                          honey the codewitch
                          wrote on last edited by
                          #12

                          That's not the main output. It's just an option to use with the parse tree. The output is actually a pull parser underneath it all, such that

                          while(parser.Read) {
                          switch(parser.NodeType)
                          {
                          case LLNodeType.NonTerminal:
                          // ... do stuff
                          case LLNodeType.Terminal:
                          // ... do stuff
                          }
                          }

                          It builds a parse tree using that, if you want it to, or you can use it directly It works almost exactly like XmlReader

                          When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.

                          1 Reply Last reply
                          0
                          • Kornfeld Eliyahu PeterK Kornfeld Eliyahu Peter

                            Maybe (however as EBNF is finite, and it makes the input finite, which makes outpute finite), but you can create XML schema for every grammar the same way/time you parse it... It should not be that hard...

                            "The greatest enemy of knowledge is not ignorance, it is the illusion of knowledge". Stephen Hawking, 1942- 2018

                            H Offline
                            H Offline
                            honey the codewitch
                            wrote on last edited by
                            #13

                            i can, but i have no real reason to although (related) eventually I may make something that compiles XSD documents into fast parser/validators for specific XML documents what i mean is i can potentially do xml validation and xml parsing in one sweep. The XSD could actually speed up the parse compared to parsing raw XML maybe down the road.

                            When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.

                            Kornfeld Eliyahu PeterK 1 Reply Last reply
                            0
                            • H honey the codewitch

                              i can, but i have no real reason to although (related) eventually I may make something that compiles XSD documents into fast parser/validators for specific XML documents what i mean is i can potentially do xml validation and xml parsing in one sweep. The XSD could actually speed up the parse compared to parsing raw XML maybe down the road.

                              When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.

                              Kornfeld Eliyahu PeterK Offline
                              Kornfeld Eliyahu PeterK Offline
                              Kornfeld Eliyahu Peter
                              wrote on last edited by
                              #14

                              It maybe of interest for you https://www.genivia.com/articles/icws2008ppg.pdf[^]

                              "The greatest enemy of knowledge is not ignorance, it is the illusion of knowledge". Stephen Hawking, 1942- 2018

                              "It never ceases to amaze me that a spacecraft launched in 1977 can be fixed remotely from Earth." ― Brian Cox

                              H 1 Reply Last reply
                              0
                              • Kornfeld Eliyahu PeterK Kornfeld Eliyahu Peter

                                It maybe of interest for you https://www.genivia.com/articles/icws2008ppg.pdf[^]

                                "The greatest enemy of knowledge is not ignorance, it is the illusion of knowledge". Stephen Hawking, 1942- 2018

                                H Offline
                                H Offline
                                honey the codewitch
                                wrote on last edited by
                                #15

                                looks like someone already had my idea. :-D

                                When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.

                                1 Reply Last reply
                                0
                                • H honey the codewitch

                                  I can't use JSON for rendering a parse tree because JSON does not preserve the order of subelements and because of the way multiple values are presented it gives json problems. XML can do it, because XML preserves element order and an element can be present more than once within its parent container. But I don't want to bother if everyone hates XML. What would you do?

                                  When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.

                                  L Offline
                                  L Offline
                                  Lost User
                                  wrote on last edited by
                                  #16

                                  codewitch honey crisis wrote:

                                  But I don't want to bother if everyone hates XML.

                                  Aw, ffs, most people will not even know that it is being used. We're not religious, so we can't burn XML just because a few people don't know what it is for. If you create entire databases in XML, you'll hate it, yes. If you use it as a communication-protocol, you'll hate it too. Use it as an exchange-format, and it will work perfectly. I would store a tree in an in-memory SQLite3 database. Quick, efficient, and easy to write to a SQLite-db on disk and have the user send you their tree by mail, if you need it for debugging.

                                  Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^] "If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.

                                  H 1 Reply Last reply
                                  0
                                  • L Lost User

                                    codewitch honey crisis wrote:

                                    But I don't want to bother if everyone hates XML.

                                    Aw, ffs, most people will not even know that it is being used. We're not religious, so we can't burn XML just because a few people don't know what it is for. If you create entire databases in XML, you'll hate it, yes. If you use it as a communication-protocol, you'll hate it too. Use it as an exchange-format, and it will work perfectly. I would store a tree in an in-memory SQLite3 database. Quick, efficient, and easy to write to a SQLite-db on disk and have the user send you their tree by mail, if you need it for debugging.

                                    Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^] "If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.

                                    H Offline
                                    H Offline
                                    honey the codewitch
                                    wrote on last edited by
                                    #17

                                    I'm not even using the XML. It's just a feature i'm thinking of adding for end user devs that use my stuff.

                                    When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.

                                    L 1 Reply Last reply
                                    0
                                    • H honey the codewitch

                                      I'm not even using the XML. It's just a feature i'm thinking of adding for end user devs that use my stuff.

                                      When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.

                                      L Offline
                                      L Offline
                                      Lost User
                                      wrote on last edited by
                                      #18

                                      Consider yourself to be SQL Server; do you allow export in XML, or would you prefer not to because a few people "hate it"? Programming isn't politics, technologies don't have to be popular.

                                      Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^] "If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.

                                      realJSOPR H 2 Replies Last reply
                                      0
                                      • L Lost User

                                        Consider yourself to be SQL Server; do you allow export in XML, or would you prefer not to because a few people "hate it"? Programming isn't politics, technologies don't have to be popular.

                                        Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^] "If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.

                                        realJSOPR Offline
                                        realJSOPR Offline
                                        realJSOP
                                        wrote on last edited by
                                        #19

                                        I do crap that's not popular all the freakin time. :)

                                        ".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

                                        L 1 Reply Last reply
                                        0
                                        • realJSOPR realJSOP

                                          I do crap that's not popular all the freakin time. :)

                                          ".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

                                          L Offline
                                          L Offline
                                          Lost User
                                          wrote on last edited by
                                          #20

                                          #realJSOP wrote:

                                          I do crap that's not popular all the freakin time. :)

                                          Like asking who took your template-permissions? :laugh:

                                          Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^] "If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.

                                          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