
Peter Dimov a écrit :
David Abrahams wrote:
root.push_front( tag("articleinfo")[ title ? (comment("This title was moved"), title) : NULL , tag("author")[ tag("firstname")["Joe"], tag("surname")["Random"] ] ] )
Interesting. It doesn't look a lot like raw XML Maybe that's the point ;-)
but it certainly integrates better into C++. That too.
You're optimizing the wrong case, a toy example.
Its best usage is obviously for an XML template, where variables directly maps to the contents of an XML structure. To do that, people usually invent pseudo-languages that integrate into XML, but then they end up duplicating full programming languages, with an even uglier syntax. Being able to write an XML document and integrate it with C++ variables and logic is what that kind of stuff is for.