From: Jake Voytko (jakevoytko_at_[hidden])
Date: 2007-07-12 11:22:12
On 7/12/07, Oliver.Kowalke_at_[hidden] <Oliver.Kowalke_at_[hidden]> wrote:
> I would do it over templates - than it's type safe and a part of the xml
> validation can be done at compile time.
> typedef tag<
> mpl::vector< title, author > // tags
> mpl::vector< isbn > // atributes
> > article_info;
I hadn't considered compile-time type safety when I wrote my above example.
However, I feel an example like this might also preclude XML features like
comments. If we were to parse an existing article:
<!--Article information goes here-->
your definition doesn't immediately make it clear that the comment, when
parsed, ends up in the document tree. I may, however, just be missing
something. Complicating matters, according to the standard, they can also
appear within the document type declaration, so comments significantly
complicate the matter:
And the standard also lists retrieval of comment text as optional:
But I think that a Boost.XML library should support the retrieval of the
text of comments.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk