File: xml_new_document.Rd

package info (click to toggle)
r-cran-xml2 1.4.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 976 kB
  • sloc: cpp: 1,826; xml: 333; javascript: 238; ansic: 178; sh: 71; makefile: 6
file content (44 lines) | stat: -rw-r--r-- 1,406 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/xml_modify.R
\name{xml_new_document}
\alias{xml_new_document}
\alias{xml_new_root}
\title{Create a new document, possibly with a root node}
\usage{
xml_new_document(version = "1.0", encoding = "UTF-8")

xml_new_root(
  .value,
  ...,
  .copy = inherits(.value, "xml_node"),
  .version = "1.0",
  .encoding = "UTF-8"
)
}
\arguments{
\item{version}{The version number of the document.}

\item{encoding}{The character encoding to use in the document. The default
encoding is \sQuote{UTF-8}. Available encodings are specified at
\url{http://xmlsoft.org/html/libxml-encoding.html#xmlCharEncoding}.}

\item{.value}{node to insert.}

\item{...}{If named attributes or namespaces to set on the node, if unnamed
text to assign to the node.}

\item{.copy}{whether to copy the \code{.value} before replacing. If this is \code{FALSE}
then the node will be moved from it's current location.}

\item{.version}{The version number of the document, passed to \code{xml_new_document(version)}.}

\item{.encoding}{The encoding of the document, passed to \code{xml_new_document(encoding)}.}
}
\value{
A \code{xml_document} object.
}
\description{
\code{xml_new_document} creates only a new document without a root node. In
most cases you should instead use \code{xml_new_root}, which creates a new
document and assigns the root node in one step.
}