Skip to contents

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(...))

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

Value

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