Boost logo

Boost :

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_info isbn="foo">
      <!--Article information goes here-->
      <author>Testy McTest</author>

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, gregod at, cpdaniel at, john at