]> This file defines some S functions for computing information about an XML tree. We start by defining a recursive function that computes the list of unique tags within a document. This is useful for defining translations from these tags to another format, e.g. &TeX;. This identifies the names of the tags that one has to map to the TeX macros or environments. xmlTags function(node, exclude=c("XMLEntityRef")) { if(inherits(node, exclude)) { return(character(0)) } if(xmlSize(node) > 0) { which &sgets; xmlSApply(node, function(x, excludes) !inherits(x, excludes), excludes = exclude) vals &sgets; names(node)[which] vals &sgets; unique(c(vals, unlist(sapply(xmlChildren(node)[which], xmlTags, exclude )))) } else vals &sgets; character(0) vals }