Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

setXMLNamespace

Set the name space on a node


Description

This function sets the name space for an XML node, typically an internal node. We can use it to either define a new namespace and use that, or refer to a name space definition in an ancestor of the current node.

Usage

setXMLNamespace(node, namespace, append = FALSE)

Arguments

node

the node on which the name space is to be set

namespace

the name space to use for the node. This can be a name space prefix (string) defined in an ancestor node, or a named character vector of the form c(prefix = URI) that defines a new namespace on this node, or we can use a name space object created with newXMLNamespace.

append

currently ignored.

Value

An object of class XMLNamespaceRef which is a reference to the native/internal/C-level name space object.

Author(s)

Duncan Temple Lang

See Also

Examples

# define a new namespace
 e = newXMLNode("foo")
 setXMLNamespace(e, c("r" = "http://www.r-project.org"))

  # use an existing namespace on an ancestor node
 e = newXMLNode("top", namespaceDefinitions = c("r" = "http://www.r-project.org"))
 setXMLNamespace(e, "r")
 e

XML

Tools for Parsing and Generating XML Within R and S-Plus

v3.99-0.10
BSD_3_clause + file LICENSE
Authors
CRAN Team [ctb, cre] (de facto maintainer since 2013), Duncan Temple Lang [aut] (<https://orcid.org/0000-0003-0159-1546>), Tomas Kalibera [ctb]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.