xmlNamespaceDefinitions {XML} | R Documentation

## Get definitions of any namespaces defined in this XML node

### Description

If the given node has any namespace definitions declared within it, i.e. of the form `xmlns:myNamespace="http://www.myNS.org"`, this function provides access to these definitions. While they appear in the XML node in the document as attributes, they are treated differently by the parser and so do not show up in the nodes attributes via `xmlAttrs`.

### Usage

    xmlNamespaceDefinitions(x, addNames = TRUE)

### Arguments

`x` | the `XMLNode` object in which to find any namespace definitions
`addNames` | a logical indicating whether to compute the names for the elements in the resulting list. The names are convenient, but one can avoid the (very small) overhead of computing these with this parameter.

### Details

### Value

A list with as many elements as there are namespace definitions. Each element is an object of class XMLNameSpace, containing fields giving the local identifier, the associated defining URI and a logical value indicating whether the definition is local to this node.

### Author(s)

Duncan Temple Lang

### References

http://www.w3.org/XML

### See Also

`xmlTreeParse` `xmlAttrs` `xmlGetAttr`

### Examples

      f = system.file("exampleData", "longitudinalData.xml", package = "XML")
      n = xmlRoot(xmlTreeParse(f))
      xmlNamespaceDefinitions(n)

[Package XML version 1.2-0 Index]