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

xml_serialize

Serializing XML objects to connections.


Description

Serializing XML objects to connections.

Usage

xml_serialize(object, connection, ...)

xml_unserialize(connection, ...)

Arguments

object

R object to serialize.

connection

an open connection or (for serialize) NULL or (for unserialize) a raw vector (see ‘Details’).

...

Additional arguments passed to read_xml().

Value

For serialize, NULL unless connection = NULL, when the result is returned in a raw vector.

For unserialize an R object.

Examples

library(xml2)
x <- read_xml("<a>
  <b><c>123</c></b>
  <b><c>456</c></b>
</a>")

b <- xml_find_all(x, "//b")
out <- xml_serialize(b, NULL)
xml_unserialize(out)

xml2

Parse XML

v1.3.2
GPL (>= 2)
Authors
Hadley Wickham [aut], Jim Hester [aut, cre], Jeroen Ooms [aut], RStudio [cph], R Foundation [ctb] (Copy of R-project homepage cached as example)
Initial release

We don't support your browser anymore

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