Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 30 Jul 2014 17:25:09 -0700
From:      Marcel Moolenaar <marcel@xcllnt.net>
To:        "Simon J. Gerraty" <sjg@juniper.net>
Cc:        Alfred Perlstein <alfred@freebsd.org>, phil@juniper.net, freebsd-arch@freebsd.org
Subject:   Re: XML Output: libxo - provide single API to output TXT, XML, JSON and HTML
Message-ID:  <06AE7354-CF5D-409F-BCAB-7CD4B728DF15@xcllnt.net>
In-Reply-To: <20140730235123.AC944580A2@chaos.jnpr.net>
References:  <20140725044921.9F0D3580A2@chaos.jnpr.net> <CAETOPp13H7kyLy-1VJRDOsDbOh8A1MWZDxw1xHUBsxTRtMfc7g@mail.gmail.com> <20140728054217.AC1A0580A2@chaos.jnpr.net> <20140728055336.GJ50802@ivaldir.etoilebsd.net> <CAETOPp3hJB8Gj%2BPMj3N951krnNqCYiAOY-cPHxMCBy1CQXWJaQ@mail.gmail.com> <A1E63A7A-BB38-4CC3-B5EC-B251BE990572@mail.turbofuzz.com> <20140729230345.31E9B580A2@chaos.jnpr.net> <53D85495.4050408@mu.org> <20140730053446.DCE8D580A2@chaos.jnpr.net> <53D944F5.7000207@freebsd.org> <20140730194522.B58FE580A2@chaos.jnpr.net> <20140730235123.AC944580A2@chaos.jnpr.net>

next in thread | previous in thread | raw e-mail | index | archive | help

--Apple-Mail=_48265AB6-342B-4B6A-A5BE-772C31DFAA79
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
	charset=us-ascii


On Jul 30, 2014, at 4:51 PM, Simon J. Gerraty <sjg@juniper.net> wrote:

> This looks like the same sort of approach that Juniper used a
> over a decade ago for the BSD apps to get XML out, and which we felt was
> just too ugly to upstream, I don't see how we could support this.
> 
> Unfortunately it took me a couple of years to get a few hours of Phil's
> time, to come up with a neat API to avoid that #ifdef and if/else mess.
> On the plus side that means it covers a lot more than just XML.
> 
> We now have an API and library that can avoid the need to double the
> cost of adding new output to apps, ie you only write to libxo's api
> and it does plain TXT for you if needed.

Something that any implementation should handle is that
warn(3) and err(3) functions should do the right thing.
More precisely: I would expect that the output of a
utility when emitting some ML handles both stdout and
stderr consistently.

Also: I would hope that if we emit XML (for example),
we can do so according to a well-defined schema.

The GSoC approach seems less likely to have a good
solution for those than libxo has.

-- 
Marcel Moolenaar
marcel@xcllnt.net



--Apple-Mail=_48265AB6-342B-4B6A-A5BE-772C31DFAA79
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
	filename=signature.asc
Content-Type: application/pgp-signature;
	name=signature.asc
Content-Description: Message signed with OpenPGP using GPGMail

-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - http://gpgtools.org

iEYEARECAAYFAlPZjOUACgkQpgWlLWHuifaXRwCeLbL9tbaOdsi++lSRyt1iWTve
dHsAoIOco8fBpBMa6TfW8OxC5OHqyG4N
=2IhH
-----END PGP SIGNATURE-----

--Apple-Mail=_48265AB6-342B-4B6A-A5BE-772C31DFAA79--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?06AE7354-CF5D-409F-BCAB-7CD4B728DF15>