Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 1 Aug 2014 10:59:06 -0700
From:      John-Mark Gurney <jmg@funkthat.com>
To:        Marcel Moolenaar <marcel@xcllnt.net>
Cc:        arch@freebsd.org, Poul-Henning Kamp <phk@phk.freebsd.dk>, Marcel Moolenaar <marcel@freebsd.org>, Phil Shafer <phil@juniper.net>, "Simon J. Gerraty" <sjg@juniper.net>
Subject:   Re: XML Output: libxo - provide single API to output TXT, XML, JSON and HTML
Message-ID:  <20140801175906.GA50495@funkthat.com>
In-Reply-To: <EDD200F3-9D35-4A8D-BE3B-40B19C61CD88@xcllnt.net>
References:  <201408011550.s71FoiQo003612@idle.juniper.net> <EDD200F3-9D35-4A8D-BE3B-40B19C61CD88@xcllnt.net>

next in thread | previous in thread | raw e-mail | index | archive | help
Marcel Moolenaar wrote this message on Fri, Aug 01, 2014 at 09:25 -0700:
> On Aug 1, 2014, at 8:50 AM, Phil Shafer <phil@juniper.net> wrote:
> 
> > "Simon J. Gerraty" writes:
> >> Of course I wouldn't be surprised if the lib already handles all that ;-)
> > 
> > No, I can't manufacture memory on the fly ;^)
> > 
> > Hmmm... I could have an emergency mode where I stop trying to buffer
> > and churn out a series of small write() calls to send close tags.
> > Or perhaps just punting and refusing to write more once ENOMEM is
> > seen is the right thing.  Seeing broken output is better than limping
> > along with output that looks right but isn't.
> 
> But broken output can have nasty side-effects due to
> parsers tripping over. What we try to prevent here
> (limping along) can very easily be introduced by us
> by emitting something that trips over parsers. We
> merely pushed the limp-along problem downstream from
> us.

The just pushed the error handling further down stream...  I'd trust
a parse error more than someone handling all the odd edge cases of
missing tags, or even failure to parse the error tag...

IFF we have a proper DTD/spec that includes an error tag can we even
think of making an error document parsable when an error occured...

Either choice we make pushes the error handling down stream... One case,
it's the parser, the other case it's the consumer of the parser, but in
both cases the downstream HAS to properly handle the error however it
is signaled...

-- 
  John-Mark Gurney				Voice: +1 415 225 5579

     "All that I will do, has been done, All that I have, has not."



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20140801175906.GA50495>