xmlReadData_to_list: Read an unidentified List of Data Types from TestCase params

Description Usage Arguments Value Author(s) Examples

View source: R/utils.xmlRead.R

Description

Read an unidentified List of Data Types from TestCase params

Usage

1

Arguments

xmlItem

Object of class XMLNode that defines a list of xmlTags that contain just elements defined in RTest XSD (list, variable, text, data.frame, vector)

Value

args (list) All the elements named by their tag and containing the value defined in the xml

Author(s)

Sebastian Wolf <sebastian.wolf@roche.com>

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
data <- '<mylist>

<inputitem1>
<col-defs>
  <coldef name="Column1" type="character"/>
  <coldef name="Column2" type="numeric"/>
</col-defs>
<row name="1"><cell>ID1</cell><cell>1</cell></row>
<row name="2"><cell>ID2</cell><cell>2.1</cell></row>
<row name="3"><cell>ID3</cell><cell>3.1</cell></row>
</inputitem1>
<inputitem2 type="numeric"><element>1</element><element>2</element></inputitem2>

</mylist>
'
item <- XML::xmlRoot(XML::xmlParse(data,asText=TRUE))
value <- RTest::xmlReadData_to_list(item)

stopifnot(names(value)[1]=="inputitem1")
stopifnot(names(value)[2]=="inputitem2")
stopifnot(length(value[[2]])==2)

RTest documentation built on Dec. 4, 2019, 5:07 p.m.