[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [xmlblaster-devel] c socket lib



Martin Johnson wrote:

Hi Marcel

Apologies for not being clear.

correct me if I'm wrong messageContentToXml() will returns to me

//--
<key oid='etc ...' />
...
</key>

<content size= ....

<![CDATA content (which is xml doc for me in this case)...

</content>

<qos>
...
</qos>
//--


I was wanting to pass this to xerces for a sax parse to make life easier for me with the document I'm recv'ing as a publisher.

I will recv a parse error for the above as the parse ends at </key>.

So I would like to see either expansion of api to include functions like.

messageContentToXml renamed to messageToXml (or something like that)

and alternatives for the individual elements.

messageKeyToXml()     returning <key>...</key>
messageContentToXml() returning <content>...</content>
messageQosToXml()     returning <qos>...</qos>

each returning the relevant subset of the messageContentToXml() function.

Or

All three are wrapped up in <message>...</message> or similar.

Ahhh, now i see your point. messageContentToXml() intend is just quickly get a string of the message to look at for our demo.

The real way is to take the message out of msgUnitArr yourself:

update(...) {
 ...
 for (i=0; i<msgUnitArr->len; i++) {
   MsgUnit *msg = &msgUnitArr->msgUnitArr[i];
   /* Now you have the raw message:
   msg->key
   msg->contentLen
   msg->content
   msg->qos
   */
 }
}

Note that the msg is freed by our library (the caller of update())
so if you need it longer then the scope of update() you
need to copy it into your own stucts.

regards

Marcel



Regards


Martin





--
http://www.xmlBlaster.org