the pain of raw xml

Tue, Aug 4, 2009

It’s like the dark ages in here just now. Being so used to working in Java with XMLBeans I’ve been spoiled when it comes to XML handling. I never have to see it. OK, I have to design XML schemata now and then if they don’t exist but it means I can work on XML as domain objects. Now, working in C++ again, it’s back to raw XML. Here’s an example:

with Java and XMLBeans I could just do:

with C++ I have to do a bit more work:

not only that, look at the mess on the second last line of code:

a Text Node of all things. Instead of the XML you see, this is actually the case:

I ask you! I knew that but when I first started working with XML it threw me. Why on earth? What the?

comments powered by Disqus