From 54c28ced1682d18778b96bf50602cd058bbac162 Mon Sep 17 00:00:00 2001 From: mfranz Date: Sun, 1 Jul 2007 18:54:32 +0000 Subject: [PATCH] what I do best: cosmetics --- Nasal/io.nas | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/Nasal/io.nas b/Nasal/io.nas index adf6c561c..cea82f4aa 100644 --- a/Nasal/io.nas +++ b/Nasal/io.nas @@ -72,15 +72,17 @@ var readxml = func(file, prefix = "___") { return parsexml(file, start, end, data) == nil ? nil : tree; } -# Writes a property tree as returned by readxml() to a file. Chidren +# Writes a property tree as returned by readxml() to a file. Children # with name starting with are again turned into attributes of # their parent. must contain exactly one child, which will -# become the XML file's outmost element. +# become the XML file's outermost element. # var writexml = func(file, node, indent = "\t", prefix = "___") { var root = node.getChildren(); - if(!size(root)) die("writexml(): tree doesn't have a root node"); - if(substr(file, -4) != ".xml") file ~= ".xml"; + if(!size(root)) + die("writexml(): tree doesn't have a root node"); + if(substr(file, -4) != ".xml") + file ~= ".xml"; var fh = open(file, "w"); var pre = size(prefix); write(fh, "\n\n"); @@ -108,7 +110,8 @@ var writexml = func(file, node, indent = "\t", prefix = "___") { } writenode(root[0]); close(fh); - if(size(root) != 1) die("writexml(): tree has more than one root node"); + if(size(root) != 1) + die("writexml(): tree has more than one root node"); }