XML for application configuration
-
Hi, At the moment I am thinking about rewriting config file package which we use in our company. Can anybody recommend me to use XML for application configuration. Unfortunately I do not have big experience about XML. Can you tell which advantages can I get from using XML? Is there any C++ packages ready which can validate XML file and for example give me the value of an item under section? (I am talking in terms of standard INI files). Any ideas, suggestions? Thanks, Igor Proskuriakov
-
Hi, At the moment I am thinking about rewriting config file package which we use in our company. Can anybody recommend me to use XML for application configuration. Unfortunately I do not have big experience about XML. Can you tell which advantages can I get from using XML? Is there any C++ packages ready which can validate XML file and for example give me the value of an item under section? (I am talking in terms of standard INI files). Any ideas, suggestions? Thanks, Igor Proskuriakov
I've been doing almost the same thing. :) XML can be a real pain to get to grips with. For something that ends up so simple and does such a simple job, it's very complicated behind the scenes. Also, the W3C XML specification document is one of the most poorly written pieces of technical writing I have ever seen. (In terms of language and choice names (e.g. "element" means about three completely different things depending on context), and in terms of physical layout if you are trying to read it from top to bottom with no prior understanding (it's as if it assumes you've already read it before you read it).) I have not tried the Microsoft XML API because I fundamentally disagree with expecting my users to have a certain version of a WEB BROWSER to use my completely unrelated program, and also because I don't want to go anywhere near COM if I can help it. I have tried two OpenSource APIs and have ended up going wiht LibXml. Aside from requiring some tweaks to compile on Win32 (someone usually makes a compiled version available after an update is made), I have found it does the job pretty well. The other one I tried was Xerces-C / XML4C, which I found was a very negative experience (but YMMV). My comments on that can be found here.
-
Hi, At the moment I am thinking about rewriting config file package which we use in our company. Can anybody recommend me to use XML for application configuration. Unfortunately I do not have big experience about XML. Can you tell which advantages can I get from using XML? Is there any C++ packages ready which can validate XML file and for example give me the value of an item under section? (I am talking in terms of standard INI files). Any ideas, suggestions? Thanks, Igor Proskuriakov
I'm using XML for program information, and found it to be quite flexible: I'm using a small XML document to store a set of database file names and server information for something like this....when I ask the program to open an XML file, I inspect the contents of the file, determine what is in it, and open the database files specified in the XML document. The amount of code to pull and save information into the XML document is much more than I wish it were (it took about 100 lines of code to wrap a simple 3 item XML document and allow the object to be persisted). I've not yet devised a "better" mouse trap, but there are a couple ways to make life easier: One possible solution would be to write a class generator based on an XML document, but I suspect that would be a never ending battle, and might not help much....
-
Hi, At the moment I am thinking about rewriting config file package which we use in our company. Can anybody recommend me to use XML for application configuration. Unfortunately I do not have big experience about XML. Can you tell which advantages can I get from using XML? Is there any C++ packages ready which can validate XML file and for example give me the value of an item under section? (I am talking in terms of standard INI files). Any ideas, suggestions? Thanks, Igor Proskuriakov
I'm using XML for program information, and found it to be quite flexible: I'm using a small XML document to store a set of database file names and server information for something like this....when I ask the program to open an XML file, I inspect the contents of the file, determine what is in it, and open the database files specified in the XML document. The amount of code to pull and save information into the XML document is much more than I wish it were (it took about 100 lines of code to wrap a simple 3 item XML document and allow the object to be persisted). I've not yet devised a "better" mouse trap, but there are a couple ways to make life easier: One possible solution would be to write a class generator based on an XML document, but I suspect that would be a never ending battle, and might not help much....