marshal.XMLAbstractNode | R Documentation |
Marshalling of 'XML' objects
## S3 method for class 'XMLAbstractNode'
marshal(xml, ...)
## S3 method for class 'XMLAbstractDocument'
marshal(xml, ...)
## S3 method for class 'XMLAbstractDocument'
marshallable(...)
## S3 method for class 'XMLAbstractNode'
marshallable(...)
xml |
An XML::XMLAbstractNode or XML::XMLAbstractDocument. |
... |
Not used. |
XML::xmlSerializeHook()
is used to produce a marshalled version
of the original object.
XML::xmlDeserializeHook()
is used to reconstruct a version of the
original object from the marshalled object.
A marshalled
object as described in marshal()
.
if (requireNamespace("XML", quietly = TRUE)) {
node <- XML::xmlParseString("<a><b>c</b></a>")
print(node)
## Marshal XMLAbstractNode object
node_ <- marshal(node)
## Unmarshal XMLAbstractNode object
node2 <- unmarshal(node_)
print(node2)
stopifnot(all.equal(node2, node))
doc <- XML::xmlParse(system.file("exampleData", "tides.xml", package = "XML"))
## Marshal XMLAbstractDocument object
doc_ <- marshal(doc)
## Unmarshal XMLAbstractDocument object
doc2 <- unmarshal(doc_)
stopifnot(all.equal(doc2, doc))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.