> Porting the setNamespace function to PHP5 would be nice. Another solution
> could be the possibility to append a namespace-node (is the
> domnamespacenode class currently used by any functions?) or the
> setAttribute checks wether some "xmlns"/"xmlns:" attribute is set and
> updates namespaceUri itself... would be more W3C standard compliant.

The namespace node isnt really used with any functions. It is also a
"special" node as its not a standard node type in libxml.
Via the specs, it doesnt really exist, but it can be returned via xpath,
which is why dom manipulates the libxml namespace into a returnable type,
which a few of the properties are allowed to work with it (otherwise either
dom would either have to prevent xpath from returning it or let the system
crash when its returned - neither of these options was acceptable - thus
this special node).

As far as setAttributeNS goes. This function actually does do checks,
however it doesnt put the element into the current namespace (which possibly
may be a logic bug - namespaces internally are so damned confusing).

Using the syntax:

$node->setAttributeNS("http://www.w3.org/2000/xmlns/";, "xmlns:b",
"http://www.somedomain.de/";);

This sets the definition on the element but doesnt put that node into the
namespace, it just puts the namespace into the scope of the node, so that
elements added with createelementns and appended as children of $node can be
placed within the namespace and would be prefixed with "b".

Now here is the question, if a namespace is not associated on the element at
that point, should the above set the element into the new namespace? (Easy
enough to implement, but really have no clue if this is the proper logic or
not). Any namespace gurus around here?

Rob

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to