XML Output: libxo - provide single API to output TXT, XML, JSON and HTML

Marcel Moolenaar marcel at xcllnt.net
Thu Jul 31 00:25:17 UTC 2014


On Jul 30, 2014, at 4:51 PM, Simon J. Gerraty <sjg at 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 at xcllnt.net


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 203 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.freebsd.org/pipermail/freebsd-arch/attachments/20140730/03d39670/attachment.sig>


More information about the freebsd-arch mailing list