Re: [xml] exchanging xml over a network

In other words: count the characters, prepend the size in bytes to the
packet, and stream the whole thing? I suppose that does make sense,
but I'm a little concerned about the overhead.

Use HTTP as suggested elsewhere. Then you can either prepend the size
using the Content-length header like this:

    Content-Type: application/xml
    Content-Length: 419041


Or you can use chunked transfer encoding, in which no content length is
specified in advance and instead the content is written out in chunks, eg.
4096 bytes at a time with the length printed in ascii at the start of each
chunk (google for more details).

Anyway, HTTP is definitely the best choice for interoperability, so use it
if you possibly can.


Print XML with Prince!

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