xmlSerializeHook(XML)
xmlSerializeHook()所属R语言包:XML
Functions that help serialize and deserialize XML internal objects
功能,帮助XML序列化和反序列化的内部对象
译者:生物统计家园网 机器人LoveR
描述----------Description----------
These functions can be used to control how the C-level data structures associated with XML documents, nodes, XPath queries, etc. are serialized to a a file or connection and deserialized back into an R session. Since these C-level data structures are represented in R as external pointers, they would normally be serialized and deserialized in a way that loses all the information about the contents of the memory being referenced. xmlSerializeHook arranges to serialize these pointers by saving the corresponding XML content as a string and also the class of the object. The deserialize function converts such objects back to their original form.
这些功能可以用来控制C-级的数据结构序列化到XML文件,节点,XPath查询等相关AA文件或连接到R会话和反序列化回。由于这些C-级数据结构的在R作为外部指针表示,他们通常会被序列化和反序列化的方式被引用的内存的内容,失去了所有的信息。 xmlSerializeHook安排序列化保存相应的XML内容作为一个字符串类的对象的指针。反序列化功能将对象返回到其原来的形式。
These functions are used in calls to saveRDS and readRDS via the refhook argument. saveRDS(obj, filename, refhook = xmlSerializeHook) readRDS(filename, refhook = xmlDeserializeHook)
使用这些函数在调用saveRDS和readRDS通过refhook参数。 saveRDS(obj, filename, refhook = xmlSerializeHook) readRDS(filename, refhook = xmlDeserializeHook)
用法----------Usage----------
xmlSerializeHook(x)
xmlDeserializeHook(x)
参数----------Arguments----------
参数:x
the object to be deserialized, and the character vector to be deserialized.
的对象进行反序列化和反序列化一个字符向量。
(作者)----------Author(s)----------
Duncan Temple Lang
参考文献----------References----------
参见----------See Also----------
saveRDS and readRDS
saveRDS和readRDS
实例----------Examples----------
z = newXMLNode("foo")
f = system.file("exampleData", "tides.xml", package = "XML")
doc = xmlParse(f)
hdoc = as(doc, "XMLHashTree")
nodes = getNodeSet(doc, "//pred")
saveRDS(list(a = 1:10, z = z, doc = doc, hdoc = hdoc, nodes = nodes), "tmp.rda",
refhook = xmlSerializeHook)
v = readRDS("tmp.rda", refhook = xmlDeserializeHook)
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|