[.XMLAttributes | R Documentation |
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.
## S3 method for class 'XMLAttributes'
x[name]
## S3 method for class 'XMLAttributes'
x$name
## S3 method for class 'XMLAttributes'
names(x)
x |
the |
name |
the name of the attribute whose value is to be retrieved. |
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).
names
returns a character vector
giving the names of the attributes in the XML node.
$
and [
return the value of
the specified attributes.
Duncan Temple Lang
http://www.omegahat.org/Sxslt, http://www.omegahat.org/SXalan, http://www.w3.org/Style/XSL
[[.XPathNodeSet
[[.XMLChildren
node.xsl
, node.xml
and ok.R
in the examples directory.
## Not run:
f <- function(nodeSet) {
node <- nodeSet[[1]]
paste(names(node), collapse=", ")
}
# registerXSLFunction("foo", f)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.