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 Mon Sep 21 15:53:26 2020.
If you see any errors or have comments, please let us know.
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License