|
Boost : |
Subject: Re: [boost] [GSOC] XML library of Boost
From: Andrey Semashev (andrey.semashev_at_[hidden])
Date: 2013-05-05 06:50:30
On Sunday 05 May 2013 11:53:14 Bjorn Reese wrote:
> On 05/01/2013 05:15 PM, Stefan Seefeld wrote:
> > As I have argued many times before on this list, I think it would be
> > foolish to try to reimplement all the functionality to support XML.
>
> I went back to read those discussions, and I think that there are good
> points on both sides. In my experience, most people only need a simple
> XML parser without all the extra features of XML Schema, XSLT, etc.
> Others also need fairly simple extensions such as XPath, and finally
> some need the full monty. It all depend on their use cases.
>
> > I agree with others that in the context of boost this should be about
> > defining a good XML API, and then map that to existing libraries. In
>
> Here is an alternative suggestion. Parsing the XML syntax is fairly
> simple, so we could provide a basic XML parser for those with simple
> needs. This XML parser should be based on the Builder design pattern
> (somewhat reminiscient of a SAX interface). The default builder will
> create our own tree/DOM, with which you can do nothing by simple tree
> manipulation. In case we need more complex features, such as XML
> Schema, we could provide a builder for, say, libxml2, which generates
> libxml2 trees that can be used, via the XML APIs you envision, to
> invoke the the libxml2 XML Schema validation.
>
> This approach allows us to have a simple XML parser for projects like
> Boost.Serialization and Boost.PropertyTree without the need for an
> external dependency. It also allows us to do more advanced stuff with
> external dependencies.
+1 for this approach.
I agree with Stefan that XML in whole is a too large project, and this
approach allows to work on it gradually. A SAX-like parser (with the builder
API) is big enough of itself for a GSOC project, IMHO, and it lays a good
foundation for further additions like DOM and XSLT while being very useful by
itself.
My only wish for the DOM/XSLT/XPath part is that it should provide a portable
and consistent C++ API regardless of the used backend, be that libxml2,
xerces/xalan or MSXML. The same applies to the SAX parser part, if it is
backed by a third party library.
Speaking of the third party dependencies, care must be taken for choosing the
backend with the least restricting license. Permissive licensing of Boost is
one of the keys to its success, IMHO. In fact, the licensing issue may be one
reason to have our own BSL-licensed implementation, at least of some subset of
XML (my preference would be at least the SAX parser).
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk