Re: [Libxmlplusplus-general] Multiple Node types
- From: Christophe de Vienne <cdevienne alphacent com>
- To: libxmlplusplus-general lists sourceforge net
- Subject: Re: [Libxmlplusplus-general] Multiple Node types
- Date: Mon, 9 Dec 2002 21:22:41 +0100
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Lundi 9 Décembre 2002 20:47, Murray Cumming wrote:
> On Mon, 2002-12-09 at 20:56, Christophe de Vienne wrote:
> > I'm thinking of doing a base Node class, from which will herit
> > ElementNode, CommentNode, TextNode, and the 4 other possible node types.
>
> Yes, that's what other parsers do, though it will require tedious use of
> dynamic_cast<> or get_node_type().
If we consider the first solution below (even if it is not very clear), we can
make it less painfull.
>
> > For the get_content and set_content accessors, I have 2 alternatives :
>
> It's not clear where these 2 alternatives begin and end in this
sorry. By your answer I think you anderstood what I meant.
> > A third one would be to do the second one, plus adding another accessor
> > on ElementNode with a different name. But which one ?
>
> I'm not sure what you mean here.
I meant having different accessors name in ElementNode and TextNode (sorry for
my approximative english). But anyway I don't think it's a good idea.
The more I think about it, the more I think having a unique accessor
implemented differently in each node type is the best solution.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)
iD8DBQE99PuUB+sU3TyOQjARAsYdAKCJBLFSX236ReOwLRJIO41fLFsA+ACg2FRk
zjmy0ENmThwT03MwV6CCqHw=
=VC1b
-----END PGP SIGNATURE-----
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]