Rev 7747 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed
"[<-.XMLNode" <-function(x, i, value){x$children[i] <- valueif(!is.character(i)) {names(x$children)[i] =if(inherits(value, "XMLNode"))xmlName(value)elsesapply(value, xmlName)}x}"[[<-.XMLNode" <-function(x, i, value){x$children[[i]] <- valueif(!is.character(i)) {names(x$children)[i] =if(inherits(value, "XMLNode"))xmlName(value)elsesapply(value, xmlName)}x}append.xmlNode <-function(to, ...){UseMethod("append.xmlNode")}append.XMLNode <-function(to, ...){args <- list(...)if(!inherits(args[[1]], "XMLNode") && is.list(args[[1]]))args <- args[[1]]idx <- seq(length(to$children) + 1, length=length(args))args = addNames(args)if(is.null(to$children))to$children <- argselse {to$children[idx] <- argsnames(to$children)[idx] <- names(args)}to}append.xmlNode.default <-function(to, ...)base::append(to, ...)if(FALSE) {xmlAddChild <-function(node, child) {node$children <- append(node$children, list(child))names(node$children) <- sapply(node$children,xmlName)node}}