[jdev] TCP Packet Construction
Heiner Wolf
wolf at bluehands.de
Fri Nov 5 03:28:49 CST 2004
Hi,
>What parser would you recommend? I'm looking into expat. I was using
>tinyXML, but it doesn't seem to fit the bill you are describing...
I use expat too, because it is small (binary distribution wise). Expat gives only callbacks on events like tag-open, tag-close, cdata. You need a wrapper to create XML nodes in memory, count the depth, etc. When you get a tag-close callback (_endElement) then you want to know if it was level one and what the sub-tags were.
You can see my expat wrapper here:
http://jabberstudio.org/cgi-bin/viewcvs.cgi/lluna2/Firebat2/Src/XMLProcessor.cpp?view=markup
http://jabberstudio.org/cgi-bin/viewcvs.cgi/lluna2/Firebat2/Src/XMLProcessor.h?view=markup
I don't know if you can use it right away. It has application code like logging, string classes, etc. You would need to adapt these parts. Maybe it's better just to learn from it.
hw
--
Dr. Klaus H. Wolf
bluehands GmbH & Co.mmunication KG
http://www.bluehands.de/people/hw
+49 (0721) 16108 75
--
Jabber enabled Virtual Presence on the Web: http://www.lluna.de/
Open Source Future History: http://www.galactic-developments.com/
More information about the JDev
mailing list