def namespace(self, cur, ns, out): """Find the right namespace value for this prefix, if needed create and add a new namespace decalaration on the node Handle namespace aliases""" if cur == None: cur__o = None else: cur__o = cur._o if ns == None: ns__o = None else: ns__o = ns._o if out == None: out__o = None else: out__o = out._o ret = libxsltmod.xsltGetNamespace(self._o, cur__o, ns__o, out__o) if ret == None: return None return libxml2.xmlNs(_obj=ret)
def namespace(self, cur, ns, out): """Find a matching (prefix and ns-name) ns-declaration for the requested @ns->prefix and @ns->href in the result tree. If none is found then a new ns-declaration will be added to @resultElem. If, in this case, the given prefix is already in use, then a ns-declaration with a modified ns-prefix be we created. Called by: - xsltCopyPropList() (*not* anymore) - xsltShallowCopyElement() - xsltCopyTreeInternal() (*not* anymore) - xsltApplySequenceConstructor() (*not* in the refactored code), - xsltElement() (*not* anymore)""" if cur == None: cur__o = None else: cur__o = cur._o if ns == None: ns__o = None else: ns__o = ns._o if out == None: out__o = None else: out__o = out._o ret = libxsltmod.xsltGetNamespace(self._o, cur__o, ns__o, out__o) if ret == None: return None return libxml2.xmlNs(_obj=ret)