SYNOPSISxmlNs[] xmlTreeGetNsDef(xmlNode element)
Parameters:
element - the element that you want to get the namespace
declarations from
Returns:
element
DESCRIPTIONxmlTreeGetNsDef() gets the namespaces defined on the
element element. For example, for the following XML data:
<top xmlns:ex="http://www.example.com">
<ex:item xmlns:ts="http://www.thunderstone.com"
xmlns:web="http://www.webinator.com"/>
</top>
calling xmlTreeGetNsDef() on the <item> node would return the
xmlNs for the http://www.thunderstone.com and
http://www.webinator.com namespaces, as they are defined on
<item>.
To get the namespace that applies to a node, use
xmlTreeGetNs().
EXAMPLE<$ns = (xmlTreeGetNsDef($node))>
<loop $ns>
<$prefix = (xmlTreeGetNsPrefix($ns))>
<$URI = (xmlTreeGetNsURI($ns))>
namespace $URI uses the prefix $prefix
</loop>
SEE ALSOxmlTreeGetNs