[openbeos] Re: Support Kit -- XML vs BMessages

><breaking out the fire extinguisher>
>Call me attempting to prevent a flamefest, how's this grab you? A minor 
>extension of the BMessage class: PrintToStreamXML()/ReadFromStreamXML(). The 
>IK team *already* needs to rewrite the whole class, including 
>PrintToStream(). It would be a simple matter to add a few tags and such in 
>the process of dumping it.

In general I would agree with this as an R2 type of extension. 
The problem is that XML<--> BMessage mappings are not trivial.
Often times, there are multiple levels of containers in XML. The only way
to represent that in a BMessage is a BMessage inside a BMessage. That could 
be less than fun to try to parse through. The biggest advantage to BMessages is
that they are fairly flat and easy to use. If you try to map XML into that, it 
becomes
a lot less fun to use.

Of course, PrintToStreamXML would be fine. And maybe a limited ReadFromStreamXML
would be OK. But I think that a lot of people would wonder why they could not 
use 
this generically.

For that reason, I would propose, again for an R2 type of release, the same 
solution that
Be came up with for R6 - an XML kit. I don't know the details of theirs, but I 
think that an XML 
parser that could, say, take a BMessage and map it into XML and maybe take some 
level of
XML and transform it inot a BMessage would be a good choice.



Other related posts: