R/value4attribute.R

value4attribute <-
function(node, attribute, value="value") {
    for (i in seq(length = length(node)) ) {
        childNode <- node[[i]]
        nodeAttributes <- xmlAttrs(childNode)

        if (any(grepl(attribute, nodeAttributes))) {
            return(nodeAttributes[value])
        }
    }
    return(NULL)
}
sneumann/MetShot documentation built on May 30, 2019, 5:05 a.m.