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

newXMLNamespace

Add a namespace definition to an XML node


Description

This function, and associated methods, define a name space prefix = URI combination for the given XML node. It can also optionally make this name space the default namespace for the node.

Usage

newXMLNamespace(node, namespace, prefix = names(namespace), set = FALSE)

Arguments

node

the XML node for which the name space is to be defined.

namespace

the namespace(s). This can be a simple character vector giving the URI, a named character vector giving the prefix = URI pairs, with the prefixes being the names of the character vector, or one or more (a list) of XMLNamespace objects, e.g. returned from a call to xmlNamespaceDefinitions

prefix

the prefixes to be associated with the URIs given in namespace.

set

a logical value indicating whether to set the namespace for this node to this newly created name space definition.

Value

An name space definition object whose class corresponds to the type of XML node given in node.

Note

Currently, this only applies to XMLInternalNodes. This will be rectified shortly and apply to RXMLNode and its non-abstract classes.

Author(s)

Duncan Temple Lang

References

~put references to the literature/web site here ~

See Also

Constructors for different XML node types - newXMLNode xmlNode. newXMLNamespace.

Examples

foo = newXMLNode("foo")
 ns = newXMLNamespace(foo, "http://www.r-project.org", "r")
 as(ns, "character")

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.