[.XMLNode(XML)
[.XMLNode()所属R语言包:XML
Convenience accessors for the children of XMLNode objects.
方便的访问,为孩子们的XmlNode对象。
译者:生物统计家园网 机器人LoveR
描述----------Description----------
These provide a simplified syntax for extracting the children of an XML node.
它们提供了一个简化的语法的XML节点中提取的孩子。
用法----------Usage----------
## S3 method for class 'XMLNode'
x[..., all = FALSE]
## S3 method for class 'XMLNode'
x[[...]]
## S3 method for class 'XMLDocumentContent'
x[[...]]
参数----------Arguments----------
参数:x
the XML node or the top-level document content in which the children are to be accessed. The XMLDocumentContent is the container for the top-level node that also contains information such as the URI/filename and XML version. This accessor method is merely a convenience to get access to children of the top-level node.
XML节点或该儿童将要访问的最佳级别的文档内容。 XMLDocumentContent是容器的顶级节点,还包含如URI /文件名和XML版本的信息。这个访问器方法仅仅是为了方便获取的顶级节点的孩子。
参数:...
the identifiers for the children to be retrieved, given as integer indices, names, etc. in the usual format for the generic link{[} and link{[[} operators
为孩子进行检索的标识符,整数索引,名称等常用格式的通用link{[}和link{[[}运营商
参数:all
logical value. When ... is a character vector, a value of TRUE for all means to retrieve all of the nodes with those names rather than just the first one. FALSE gives the usual result of subsetting a list by name which gives just the first element. This allows us to avoid the idiom node[ names(node) == "bob" ] which is complicated when node is the result of an inline computation and instead we use node["bob", all = TRUE].
逻辑值。当...是一个字符向量,值TRUEall检索所有的节点名称,而不是只是第一个。 FALSE给出了通常的结果子集的名字,只提供了第一个元素的列表。这使我们能够避免这个成语node[ names(node) == "bob" ]这是复杂的,当节点的嵌入式计算的结果,而我们使用的node["bob", all = TRUE]。
值----------Value----------
A list or single element containing the children of the XML node given by obj and identified by ....
列表或单个元素包含的XML节点的孩子obj,并确定了....
(作者)----------Author(s)----------
Duncan Temple Lang
参考文献----------References----------
<h3>See Also</h3> <code>xmlAttrs</code> <code>[<-.XMLNode</code> <code>[[<-.XMLNode</code>
实例----------Examples----------
f = system.file("exampleData", "gnumeric.xml", package = "XML")
top = xmlRoot(xmlTreeParse(f))
# Get the first RowInfo element.[获取第一个RowInfo元。]
top[["Sheets"]][[1]][["Rows"]][["RowInfo"]]
# Get a list containing only the first row element[获取一个列表,其中包含的第一行元素]
top[["Sheets"]][[1]][["Rows"]]["RowInfo"]
top[["Sheets"]][[1]][["Rows"]][1]
# Get all of the RowInfo elements by position[所有的RowInfo元素的位置]
top[["Sheets"]][[1]][["Rows"]][1:xmlSize(top[["Sheets"]][[1]][["Rows"]])]
# But more succinctly and accurately, get all of the RowInfo elements[但更简洁,准确,让所有的RowInfo元素]
top[["Sheets"]][[1]][["Rows"]]["RowInfo", all = TRUE]
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|