writestruct
- : writestruct
(S, filename)¶ - : writestruct
(…, name, value)¶ Write the structure (array) S to an XML or JSON file.
The format is chosen with the
"FileType"option ("xml"or"json") or else from the file extension. Other options are"PrettyPrint"(default true),"StructNodeName"(name of the XML root element, default"struct"),"AttributeSuffix"(fields whose name ends in this suffix, default"Attribute", become XML attributes) and"Encoding"(output is always UTF-8).JSON output comes from the built-in
jsonencode, soNaNand infinite values are written asnullexactly as there. XML output is built with the Java DOM bundled with the product; non-finite numbers are written as the textNaN,Infand-Inf.