C++ guys rock XML without becoming XML parser experts
So I've got C++ projects that are like 1 MB of code and I'm supposed to add this 30 MB Xerces C++ to it just to parse and create a snippet of XML? Are you kidding me?
Do I really have to study oodles of document object model documentation just to extract the text between a start tag and an end tag? Are you joking?
All the time I invest in a big bloated XML infrastructure will pay off? Are you in your right mind?
XML was SUPPOSED TO BE a simple clean portable data format!
If you look around the web, you'll find plenty of articles telling you how to avoid the pitfalls of XML... but they all want to teach you more technical concepts and layers of abstraction!
They are saying that in order to avoid getting caught in a rat's nest you must dive down into a different rat's nest first! How much help is that?
And half the time you go into a project or a requirement, you do not have control over the architecture. You can't impose some XML infrastructure on it!
Actually there are lighter and easier C++ XML tools than Xerces. But most all of them have a major design problem called "DOM." The document object model was created by academics, for academics.
The DOM is actually a brilliant read! Enjoy it, really! ;)
The fact is, the DOM was not designed by commercial programmers. DOM was created by University folks who could not create simple usable robust software if their life depended on it. Don't get me wrong. University folks play a very important role in the food chain of software, but they can screw it up royally too.
The DOM was not built for practical people who just want to get things done, and done right.
The amazing and sad thing is that developers start working for XML rather than it working for them. Tremendous amounts of time are wasted on designing, maintaining and deploying XML schemas: XML that describes XML! This, for a data format that was billed as "self-describing!"
XML takes on a life of its own in many software houses.
Show me examples of the XML itself. I don't want a complex meta-language, potentially out of step description of it! Show me the real stuff and I can figure out how to make it and get what I want out of it.
If you ask me what makes software simple and robust, I say one word: smallness -- keeping integration, configuration, objects, methods, and footprint to a minimum. And no dependencies! Why add requirements on top of those you already have?
Seriously, why should it take more than a minute to download and try a scrap of C++ XML parser code in your own C++ project?
Most parsers take a week or a month to master, which is a very expensive investment, especially if you didn't need that much of it.
And then if there is just one little problem, you've got this big lug of a "free" 3rd party tool to trouble shoot out there in the wild web of compliance with quasi-official standards that keep getting updated. A very expensive predicant.
That's thousands and thousands of dollars expensive.
You go out on the forums looking for others who've had the same problems with using the DOM object pointers and wonder if it would have been quicker to do the XML yourself instead of learning how to work with someone else's tree node linked lists.
You might even spend a lot of valuable time writing a wrapper around this tool to make it easier for your team. With all this time and effort sunk into it, you can never admit its true cost to yourself let alone your boss.
Well, hopefully that's not a reality for you. Or maybe it was a reality for you with another tool, not a C++ XML tool. I say this because I've got a small C++ XML product used by thousands of practical developers around the world. WinZip uses it for its XML parsing and creation, as do developers at Boeing, Adobe, Kodak, Texas Instruments, Motorola etc.
It is not rocket science. It has method names that seem a bit funny to me now like
But it is just one object with a bunch of methods that can do what I needed to do with XML in the past 11 years.
In 1999 I was frustrated looking for something to help parse and create some XML messages so I rolled my own C++ XML parser class called CMarkup. Other developers found it useful. In 2001 I posted it to CodeProject and it was article of the week.
Here is how it works: you use one C++ class representing an XML document. You use the class to extract, modify and generate XML (and HTML too).
Because it doesn't have DOM objects under the covers, CMarkup handles large XML faster and with a smaller footprint than any other XML tool out there.
A customer reported CMarkup takes one third the memory footprint of TinyXML.
Download the source code of the evaluation version of CMarkup which is fully functional and includes everything that most customers initially want. It is free to compile in your non-commercial programs.
There are videos showing how to add it to a C++ project, and a fast start article, so you can be up and running quickly.
Do that first. Then if you want the full functionality developer version it is $249.
These are C++ guys and gals who got their XML done fast, not by becoming experts in everything XML, but by choosing an easier way:
Download the free source code evaluation and follow the Quick Start instructions to add it into your project in no time. Try C++ XML parser CMarkup.