Re: [xml] how do I...

Daniel Veillard <veillard redhat com> wrote:
On Tue, May 24, 2005 at 04:24:55PM -0600, Sebastian Kuzminsky wrote:
My network format already includes an end-of-document marker which never
appears inside the document ('\n'), so I guess I'm standards-compliant,
if only by dumb luck.  :)

  Hum, the problem is that \n is perfectly legal within XML documents,
and quite common there. So it works because the kind of data don't
require it but it's not a good solution. You should still be able
to use other separators chars in markup and escape it to a numeric
character reference if really needed, but still this is very limited.
I assume your documents are short, in which case a stream of
  [(inti, documenti) *]  where inti == len(documenti)
would be quite easier to handle, as you can directly read the right number 
of bytes and then pass directly the complete buffer for a single pass

True; in the wild, '\n' is all over the place, for example here --->


But in my little toy universe I make the rules, and I decreed that no
message may include it.  Maybe it'd be more convenient to use '\0', or to
prepend the length like you suggest.  I was just hoping XML would "just do
it" for me, but I stand corrected.  Thanks for your help, I appreciate it.

Sebastian Kuzminsky
"Marie will know I'm headed south, so's to meet me by and by"
-Townes Van Zandt

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