In article <>, <> wrote:
[...]
% So, our first option would use a complete document in each direction
% as the whole connection.. eg)
[...]
% What is the best parse model for this? Because the <messages> are
% never going to be that big, DOM would be nice b/c it seems simpler to
% code. But can DOM be applied to just a section of the whole document?
DOM parses the entire document before giving the tree back to you.
% Is our only (standard) option here to use SAX?
Standard is a relative term, but yes.
% The other option I thought of is to add some framing so each message
% is its own document..
% NUMBER_OF_BYTES\r\n
% <message>
% ...
% </message>
I like this approach better. Each message really _is_ its own document,
so it ought to be represented as such.
% So what is the better way? What works better with the available XML
% parsers? Our applications are writtin in Python, C and Java.
Using python, you'll probably want to use libxml as the parser, and you
might as well also use it for C. This approach will work well with
the parser -- you hand it a buffer with the document in it, and it
hands you a tree back. With java, there's more standardisation, and
any parser ought to handle it OK.
--
Patrick TJ McPhee
East York Canada