def specialNamespace(self, cur, URI, prefix, out): """Find the right namespace value for this URI, if needed create and add a new namespace decalaration on the node""" if cur == None: cur__o = None else: cur__o = cur._o if out == None: out__o = None else: out__o = out._o ret = libxsltmod.xsltGetSpecialNamespace(self._o, cur__o, URI, prefix, out__o) if ret == None: return None return libxml2.xmlNs(_obj=ret)
def specialNamespace(self, invocNode, nsName, nsPrefix, target): """Find a matching (prefix and ns-name) ns-declaration for the requested @nsName and @nsPrefix 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. Note that this function's priority is to preserve ns-prefixes; it will only change a prefix if there's a namespace clash. If both @nsName and @nsPrefix are None, then this will try to "undeclare" a default namespace by declaring an xmlns="".""" if invocNode == None: invocNode__o = None else: invocNode__o = invocNode._o if target == None: target__o = None else: target__o = target._o ret = libxsltmod.xsltGetSpecialNamespace(self._o, invocNode__o, nsName, nsPrefix, target__o) if ret == None: return None return libxml2.xmlNs(_obj=ret)