Scilab Website | Contribute with GitLab | Scilab Community | ATOMS toolboxes
Scilab Online Help
2026.1.0 - Français


xmlFormat

Format a Scilab variable into XML

Syntax

xmlCode = xmlFormat(scilabVar)

Arguments

scilabVar

scilabVar, a Scilab's variable

xmlCode

xmlCode, a string containing XML code

Description

This function does nothing by itself ! It needs to be overloaded to be useful.

It is used when a Scilab variable is inserted in the XML tree.

Examples

xdoc = xmlReadStr("<root><a att=""foo"" rib=""bar""><b>Hello</b></a></root>");
// This code will fail:
// xdoc.root.children(1.5) = 1.23456;

// Now we define %s_xmlFormat to handle double type
// Take care, in this example, the double matrix is not handled
function y=%s_xmlFormat(x), y="<number>" + string(x) + "</number>", endfunction;

// we retry a number insertion
xdoc.root.children(1.5) = 1.23456;
xmlDump(xdoc)

xmlDelete(xdoc);

History

VersionDescription
5.4.0 XML module introduced.
Report an issue
<< xmlElement Traitement XML xmlGetNsByHref >>

Copyright (c) 2022-2026 (Dassault Systèmes S.E.)
Copyright (c) 2017-2022 (ESI Group)
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Tue May 19 13:58:10 CEST 2026