catalogResolve(XML)
catalogResolve()所属R语言包:XML
Look up an element via the XML catalog mechanism
查找元素通过XML目录机制
译者:生物统计家园网 机器人LoveR
描述----------Description----------
XML parsers use a catalog to map generic system and public addresses to actual local files or potentially different remote files. We can use a catalog to map a reference such as http://www.omegahat.org/XSL/ to a particular directory on our local machine and then not have to modify any of the documents if we move the local files to another directory, e.g. install a new version in an alternate directory.
XML解析器使用一个通用的系统和公共地址映射到实际的本地文件或潜在的不同的远程文件的目录。我们可以使用一个目录映射参考,如http://www.omegahat.org/XSL/到本地机器上的特定目录,然后没有修改任何的文件,如果我们移动到另一个目录中的本地文件,例如:备用目录中安装新版本。
This function provides a mechanism to query the catalog to resolve a URI, PUBLIC or SYSTEM identifier.
此功能提供了一种机制来查询目录,以解决一个URI,公共或系统标识符。
This is now vectorized, so accepts a character vector of URIs and recycles type to have the same length.
现在,这是量化的,所以接受一个字符向量的URI和回收type具有相同的长度。
If an entry is not resolved via the catalog system, a NA is returned for that element. To leave the value unaltered in this case, use asIs = TRUE .
如果一个项目没有得到解决通过目录系统,NA,则返回该元素。在这种情况下,要离开值不变,使用asIs = TRUE。
用法----------Usage----------
catalogResolve(id, type = "uri", asIs = FALSE, debug = FALSE)
参数----------Arguments----------
参数:id
the name of the (generic) element to be resolved
以得到解决(通用的)元素的名称
参数:type
a string, specifying whether the lookup is for a uri, system or public element
一个字符串,指定查询是否是一个URI,系统或公共元素
参数:asIs
a logical. If TRUE any element of id which is not resolved by the catalog system will be left as given in the call. If FALSE, such unresolved elements are identified by NA.
一个逻辑。如果TRUE id目录系统仍未解决的任何元素将保留通话。如果FALSE,未解决的元素确定的NA。
参数:debug
logical value indicating whether to turn on debugging output written to the console (TRUE) or not (FALSE).
逻辑值,该值指示是否开启调试输出写入到控制台(TRUE)或没有(FALSE)。
值----------Value----------
A character vector. If the element was resolved, the single element is the resolved value. Otherwise, the character vector will contain no elements.
字符向量。得到了解决,如果该元素的单个元素的解析值。否则,字符向量将不包含元素。
(作者)----------Author(s)----------
Duncan Temple Lang
参考文献----------References----------
http://www.sagehill.net/docbookxsl/Catalogs.html provides a short, succinct tutorial on catalogs.
参见----------See Also----------
xmlTreeParse
xmlTreeParse
实例----------Examples----------
if(!exists("Sys.setenv")) Sys.setenv = Sys.putenv
Sys.setenv("XML_CATALOG_FILES" = system.file("exampleData", "catalog.xml", package = "XML"))
catalogResolve("-//OASIS//DTD DocBook XML V4.4//EN", "public")
catalogResolve("http://www.omegahat.org/XSL/foo.xsl")
catalogResolve("http://www.omegahat.org/XSL/article.xsl", "uri")
catalogResolve("http://www.omegahat.org/XSL/math.xsl", "uri")
# This one does not resolve anything, returning an empty value.[这不解决任何问题,返回一个空值。]
catalogResolve("http://www.oasis-open.org/docbook/xml/4.1.2/foo.xsl", "uri")
# Vectorized and returns NA for the first and /tmp/html.xsl[矢量化,并返回NA为第一和/ tmp目录/ html.xsl的]
# for the second.[对于第二个。]
catalogAdd("http://made.up.domain", "/tmp")
catalogResolve(c("ddas", "http://made.up.domain/html.xsl"), asIs = TRUE)
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|