|
Boost : |
From: Robert Ramey (ramey_at_[hidden])
Date: 2005-06-09 21:09:52
This sort of question comes up from time to time.
On one hand, one has as an archive syntax one wants to target.
On the other hand, one's program has a structure of C++ class instances
which implement the code.
Only by the most fortunate of coincidences are these going to match.
There are tools which, given an XML schema will produce matching C++
classes.
The serialization system does the opposite. That is, given C++ instances it
will produce XML.
So this may not be what you want. You might be able to make it work if you
craft your C++ data structures with this in mind and/or derived your special
archive class.
I considered the possibility of automatically generating an XML schema
(*.xsd) which would be generated in parallel with the XML output. But it
turned out not to be necessary for serialization. But I believe that would
permit one to use some other tool to transform the serialization out XML
into something more to taste.
Robert Ramey
Oliver Kullmann wrote:
> Hello,
>
> I want to build up a database of timing
> results, and these timing results should
> be stored in xml-files.
>
> It seems that the only library in Boost providing
> xml-functionality is the Serialization library.
> Now in principle it could work fine:
> Basically I could create a struct with string
> tags describing the timing context, and a container with
> the timing results; via serialisation I write it
> to an xml-archive, and as additional bonus I also
> can read it back.
>
> However I have the following concerns:
>
> 1. The xml-archives must be human-readable.
> 2. The xml-archives should be also usable with
> other xml applications.
>
> Regarding 1., it seems that readability for the current output is
> kind of alright --- but this doesn't seem to be guaranteed for the
> future?
>
> Brings me to point 2: It seems that the xml-format is not specified,
> and thus is a kind of "proprietary file format", changed at will
> with new releases --- is this the intention, or not?!
>
> To me it would make perfect sense, that at least the xml-archives can
> be used by other applications, and for that there should be a document
> type definition (dtd) available for each archive, and furthermore the
> general structure should be standardised.
>
> But perhaps this is not intended for this library.
> I would be glad for any comments.
>
> Thanks!
>
> Oliver
>
> _______________________________________________
> Unsubscribe & other changes:
> http://lists.boost.org/mailman/listinfo.cgi/boost
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk