XMLAttributes: Access attributes of XML Node

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

These functions provide access to the elements of a collection of XML attributes of an XML node. The usual list operators apply ([, $, etc.) but are implemented by accessing the C-level structure representing the set of attributes.

Usage

1
2
3
4
5
6
## S3 method for class 'XMLAttributes'
x[name]
## S3 method for class 'XMLAttributes'
x$name
## S3 method for class 'XMLAttributes'
names(x)

Arguments

x

the XMLAttributes object whose contents are to be queried.

name

the name of the attribute whose value is to be retrieved.

Details

The XMLAttributes objects are not regular named character vectors in S but instead are references to C level structures managed by the XSLT engine. They are accessible as read-only values (as it makes little sense to modify them since they are not part of the output document).

Value

names returns a character vector giving the names of the attributes in the XML node. $ and [ return the value of the specified attributes.

Author(s)

Duncan Temple Lang

References

http://www.omegahat.org/Sxslt, http://www.omegahat.org/SXalan, http://www.w3.org/Style/XSL

See Also

[[.XPathNodeSet [[.XMLChildren node.xsl, node.xml and ok.R in the examples directory.

Examples

1
2
3
4
5
6
7
8
## Not run: 
  f <- function(nodeSet) {
    node <- nodeSet[[1]]
    paste(names(node), collapse=", ")
  }
  # registerXSLFunction("foo", f)

## End(Not run)

sckott/sxslt documentation built on May 29, 2019, 4:06 p.m.