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



hi there,

while methods such as 'get_attribute' or 'get_content' look fairly
innocent and just like arbitrary accessors, they are not. They may
involve quite a bit of internal processing, such as entity replacement
or default value lookup in the dtd/schema.

It is therefor important to clearly define what those methods should
do, or, if necessary, provide alternative ways to access the 'raw'
content vs. access the preprocessed data.

For example, with the single attribute access point 'get_attribute'
we either can figure out what attribute was really given in the 'raw'
document, or, what the attribute logically is (i.e. in case there is
a default value, take this if it is not explicitely given).

Is only one of them valid in the context of xml ? If so, it's probably
the latter. If not, we may consider adding a new accessor, or add a
bool parameter to 'get_attribute'. Actually, in case of attributes,
there is another solution: just disconnect the document from its dtd,
so all the xml parser can access is the raw document data itself.

However, the problem is really a fundamental one, which is why I'd like
to discuss it in more general terms.

Regards,
		Stefan





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