XML (version 3.99-0.16.1)

toString.XMLNode: Creates string representation of XML node

Description

This creates a string from a hierarchical XML node and its children just as it prints on the console or one might see it in a document.

Usage

# S3 method for XMLNode
toString(x, ...)

Value

A character vector with one element, that being the string corresponding to the XML node's contents.

Arguments

x

an object of class XMLNode.

...

currently ignored

Author

Duncan Temple Lang

Details

This uses a textConnection object using the name .tempXMLOutput. Since this is global, it will overwrite any existing object of that name! As a result, this function cannot be used recursively in its present form.

References

https://www.w3.org/XML//, http://www.jclark.com/xml/

See Also

xmlNode xmlTreeParse

Examples

Run this code
 x <- xmlRoot(xmlTreeParse(system.file("exampleData", "gnumeric.xml", package = "XML")))

 toString(x)

Run the code above in your browser using DataLab