Find a namespace definition object by searching ancestor nodes
Find a namespace definition object by searching ancestor nodes
This function allows one to search an XML tree from a particular node and find the namespace definition for a given namespace prefix or URL. This namespace definition can then be used to set it on a node to make it the effective namespace for that node.
ns: a character string (vector of length 1). If asPrefix is TRUE, this is the namespace alias/prefix. If asPrefix is FALSE, this is the URL of the namespace definition
asPrefix: a logical value. See ns.
doc: the XML document in which the node(s) are located