[xml] Namespace Question


during the weekend i revisited some code related to libxml2's namespaces.
currently i face the fact, that libxml2 defines namespace nodes as a 
special structure and not as i would expect as some structure that has 
common node member variables. my problem is that i want to access 
a namespace with common node functions (such as DOMs 'nodeName()') through
my interface. since DOM specifies the attributes member to contain also
a nodes namespace declarations, i think it's usefull to have at least some
similarities in the interface. 

to provide DOM conform functions with the current implementation on namespaces
i need to wrap the namespace node through an attribute node, which is 
a) dirty and b) slow, since i can't track, which namespace i already wrapped
and there is the need to find the node where a namespace is declared. 

i got through the DOM (L3) spec and it seems namespaces are treated as 
attributes while XPath-DOM (L3) defines a separate namespace node interface.

my question is now if there is any reason why having a different structure 
for namespaces, that has nothing common with the xmlNode structure as e.g. 
xmlAttr has.

i wonder if this done for specific reasons, since i don't think it's really 
interface related.

or am i generally wrong? 


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