def copyNamespace(self, elem, ns): """Copies a namespace node (declaration). If @elem is not None, then the new namespace will be declared on @elem.""" if elem == None: elem__o = None else: elem__o = elem._o if ns == None: ns__o = None else: ns__o = ns._o ret = libxsltmod.xsltCopyNamespace(self._o, elem__o, ns__o) if ret == None: return None return libxml2.xmlNs(_obj=ret)
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 copyNamespaceList(self, node, cur): """Do a copy of an namespace list. If @node is non-None the new namespaces are added automatically. This handles namespaces aliases""" if node == None: node__o = None else: node__o = node._o if cur == None: cur__o = None else: cur__o = cur._o ret = libxsltmod.xsltCopyNamespaceList(self._o, node__o, cur__o) if ret == None: return None return libxml2.xmlNs(_obj=ret)
def plainNamespace(self, cur, ns, out): """Obsolete. *Not* called by any Libxslt/Libexslt function. Exaclty the same as xsltGetNamespace().""" 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.xsltGetPlainNamespace(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 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 copyNamespaceList(self, node, cur): """Do a copy of an namespace list. If @node is non-None the new namespaces are added automatically. This handles namespaces aliases. This function is intended only for *internal* use at transformation-time for copying ns-declarations of Literal Result Elements. Called by: xsltCopyTreeInternal() (transform.c) xsltShallowCopyElem() (transform.c) REVISIT: This function won't be used in the refactored code.""" if node == None: node__o = None else: node__o = node._o if cur == None: cur__o = None else: cur__o = cur._o ret = libxsltmod.xsltCopyNamespaceList(self._o, node__o, cur__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)
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)