xmlAttrs {XML} | R Documentation

## Get the list of attributes of an XML node.

### Description

This returns a named character vector giving the name-value pairs of attributes of an XMLNode object which is part of an XML document.

### Usage

     xmlAttrs(node)

### Arguments

`node` | The `XMLNode` object whose attributes are to be extracted.

### Value

A named character vector, where the names are the attribute names and the elements are the corresponding values. This corresponds to the (attr<i>, "value<i>") pairs in the XML tag `<tag attr1="value1" attr2="value2"`

### Author(s)

Duncan Temple Lang

### References

http://www.w3.org

### See Also

`xmlChildren`, `xmlSize`, `xmlName`

### Examples

     fileName <- system.file("exampleData", "mtcars.xml", package="XML")
     doc <- xmlTreeParse(fileName)

     xmlAttrs(doc$doc$children[["dataset"]])

     xmlAttrs(doc$doc$children[["dataset"]][["variables"]])

[Package XML version 0.97-7 Index]