Re: [Libxmlplusplus-general] DOM traversal and the semantics of 'get_attribute', 'get_content', etc.



It is reasonable to query the content of a given node. But what
should it return ? Before my patch, Node::get_child_content
returned an array of TextNodes. That seems to me wrong. It is
somewhat in the middle between two justifiable meanings:

1) return the set of child nodes
2) return the stringified content

ad 1)

as I suggested, I think we do need a (better) API to traver the tree.
I think the best way to achieve this (and the most intuitive one in C++)
is using iterators. In fact, if no-one is objecting, I'd like to add
that (may be still today)

ad 2)

stringified content means the actual CDATA, i.e. all markup stripped off
(equivalent of 'xsl:value-of', as opposed to 'xsl:copy-of').

I do think that 'get_content' should do 2).

Stefan





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]