Learn R Programming

xmlwriter (version 0.1.1)

as_frag: Convert a list to an xml fragment

Description

As frag is a helper function to convert a named list to an xml fragment, it transforms all values to character, and recursively transforms nested lists. as_frag can be used for flexible list created xml fragments, names of a list turn into tags, and values into text nodes.

Usage

as_frag(x, ..., .attr = list(...))

Value

xml_fragment() object as if specified with frag().

Arguments

x

named list that will be transformed into a fragment

...

optional attributes to be set on the parent of the fragment

.attr

a list of attributes to add to the parent of the fragment, overrides the ... argument

See Also

Other xml_fragment: add_child_fragment(), as.character.xml_fragment(), as_xml_nodeset(), data_frag(), frag(), xml_fragment()