Description Usage Arguments Value Author(s) Examples
View source: R/utils.xmlWrite.R
This function appends a list as an XML object to an item. The function allows setting attributes of XML items by using the "attributes" list name, therefore it can never write tags with the name "attributes"
1 | xmlFromList(node, sublist)
|
node |
( |
sublist |
( |
node (XMLNode
) A node where the list is attached to the first XML Node
Sebastian Wolf sebastian.wolf.sw1@roche.com
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | root <- XML::newXMLNode("root")
li <- list(a = list(aa = 1, ab=2),
b=list(ba = 1,
bb=list(x=4,
attributes=c(value=3)),
bb= 2,
bc =3))
xmlFromList(root,li)
# The result is an XML Node like this
#<root>
# <a>
# <aa>1</aa>
# <ab>2</ab>
# </a>
# <b>
# <ba>1</ba>
# <bb value="3">
# <x>4</x>
# </bb>
# <bb>2</bb>
# <bc>3</bc>
# </b>
#</root>
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.