Parses a list of XML `<Threshold>` nodes and extracts their attributes into named vectors grouped by attribute. The output is a named list of named vectors, where each vector corresponds to a different attribute and is indexed by the `name` attribute from each node.

readQCThresholdXMLNode(nodes, rename = TRUE)

Arguments

nodes

An `xml_nodeset` or list of XML nodes (typically `<Threshold>` nodes).

rename

Logical (default `TRUE`). If `TRUE`, renames selected attribute names: - `"value"` → `"thresholds"` - `"operator"` → `"operators"` - `"properName"` → `"properNames"` - `"explanation"` → `"explanations"`

Value

A named list where each element is a named character vector, with threshold names as names and attribute values as values.

Details

If the XML node has a text value (e.g. `<Threshold>0.3</Threshold>`), it will override the "value" attribute for that node.

Optionally, the list element names can be renamed to more descriptive keys such as `thresholds`, `operators`, `properNames`, and `explanations`.

Examples

# xml <- xml2::read_xml("your_file.xml")
# nodes <- xml2::xml_find_all(xml, ".//Threshold")
# result <- readQCThresholdXMLNode(nodes)