Examples for 'xml2::as_list'


Coerce xml nodes to a list.

Aliases: as_list

Keywords:

### ** Examples

as_list(read_xml("<foo> a <b /><c><![CDATA[<d></d>]]></c></foo>"))
$foo
$foo[[1]]
[1] " a "

$foo$b
list()

$foo$c
$foo$c[[1]]
[1] "<d></d>"
as_list(read_xml("<foo> <bar><baz /></bar> </foo>"))
$foo
$foo$bar
$foo$bar$baz
list()
as_list(read_xml("<foo id = 'a'></foo>"))
$foo
list()
attr(,"id")
[1] "a"
as_list(read_xml("<foo><bar id='a'/><bar id='b'/></foo>"))
$foo
$foo$bar
list()
attr(,"id")
[1] "a"

$foo$bar
list()
attr(,"id")
[1] "b"

[Package xml2 version 1.3.3 Index]