Name

toString()

Examples
xml = loadXML("mammals.xml")
# Format with line breaks, XML declaration, and 2-space indentation
s = xml.toString()
print(s)
# Sketch prints:
# <mammals>
#   <animal id="0" species="Capra hircus">Goat</animal>
#   <animal id="1" species="Panthera pardus">Leopard</animal>
#   <animal id="2" species="Equus zebra">Zebra</animal>
# </mammals>
Description Takes an XML object and converts it to a String, using default formatting rules (includes an XML declaration, line breaks, and two spaces for indents). These are the same formatting rules used by print() when printing an XML object. This method produces the same results as using format(2).
Syntax
.toString()
Related format()

Updated on Tue Feb 27 14:07:12 2024.

If you see any errors or have comments, please let us know.