Scilab Home page | Wiki | Bug tracker | Forge | Mailing list archives | ATOMS | File exchange
Please login or create an account
Change language to: English - Français - Português - 日本語
Справка Scilab >> XML Management > xmlWrite

xmlWrite

Write a XML document in a file

Syntax

xmlWrite(doc [, filename] [, indent])
xmlWrite(doc [, indent])

Arguments

doc

doc, a mlist typed XMLDoc

filename

filename, a string

indent

indent, a boolean

Description

Write a XML document in a file with the given filename or with the document url. If indent is true, then the document will be indented, by default indent is true.

Examples

doc = xmlReadStr("<root><a att=""foo"" rib=""bar""><b>Hello</b></a></root>");
xmlWrite(doc, TMPDIR+"/foo.xml", %f);

// Now we open the previous file, modify it and save it
doc1 = xmlRead(TMPDIR+"/foo.xml");
doc1.root.children(1).name = "newName";
xmlWrite(doc1);

// Now we check that the modification has been done
doc2 = xmlRead(TMPDIR+"/foo.xml");
doc2.root.children(1).name

xmlDelete("all");

See also

History

ВерсияОписание
5.4.0 XML module introduced.
Scilab Enterprises
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Tue Feb 14 15:13:25 CET 2017