1 function xmlsave( fileName, SData, varargin)
9 throwerror(
'wrongInput',
'SData is an obligatory input argument');
12 [reg,~,isTsInserted]=
mxberry.
core.parseparext(varargin,...
13 {
'insertTimestamp';
true;
'islogical(x)&isscalar(x)'},[0 2],...
14 'regDefList',{
'on',
struct()},...
17 @(x)isstruct(x)&&isscalar(x)&&all(structfun(@ischar,x))});
22 if isempty(strfind(lower(fileName),
'.xml'))
23 fileName = strcat(fileName, '.xml');
26 [fid,errMsg] = fopen(fileName, 'w');
29 'Failed to open file %s for writing: %s',fileName,errMsg);
32 fprintf(fid, '<?xml version="1.0"?>\n');
35 fprintf(fid, sprintf('<!-- written on %s -->\n', datestr(now)));
39 fprintf(fid, '%s',
xmlformat(SData, attSwitch,'root',0,SMetaData));
function throwerror(in msgTag, in varargin)
THROWERROR works similarly to built-in ERROR function in case when there is no output arguments but s...
function checkgen(in x, in typeSpec, in varargin)
CHECKGEN checks a generic condition provided by typeSpec string in the following format: 'isnumeric(x...
function xmlformat(in SData, in attSwitch, in name, in level, in SMetaData)
XMLFORMAT formats the variable V into a name-based tag XML string xstr.
function isstring(in inpArray)
function xmlsave(in fileName, in SData, in varargin)
XMLSAVE saves structure or variable(s) to a file using XML format.
function ismember(in leftVec, in rightVec, in varargin)
ISMEMBER - ismember implementation for arrays of any type.