Mercurial > hg > ltpda
view m-toolbox/classes/@unit/attachToDom.m @ 46:ca0b8d4dcdb6 database-connection-manager
Fix
author | Daniele Nicolodi <nicolodi@science.unitn.it> |
---|---|
date | Tue, 06 Dec 2011 19:07:27 +0100 |
parents | f0afece42f48 |
children |
line wrap: on
line source
function collectedHist = attachToDom(objs, dom, parent, collectedHist) if isempty(objs) % Create empty unit node with the attribute 'shape' utils.xml.attachEmptyObjectNode(objs, dom, parent); else for oo = 1:numel(objs) obj = objs(oo); appendChild = true; % Don't create a unit node if the method is called by one of the % properties: xunits, yunits, ounits, iunits % Remark: This is only possible if the propertie have only one unit % object nodeName = utils.xml.mchar(parent.getNodeName); if ~isempty(regexp(nodeName, '.units', 'match')) && numel(objs) == 1 unitNode = parent; appendChild = false; else % Create object node unitNode = dom.createElement('unit'); end % Set shape unitNode.setAttribute('shape', sprintf('%dx%d', size(objs))); % Call superclass collectedHist = attachToDom@ltpda_nuo(obj, dom, unitNode, collectedHist); % Add strs unitNode.setAttribute('strs', utils.xml.cellstr2str(obj.strs)); % Add exps unitNode.setAttribute('exps', utils.xml.mat2str(obj.exps)); % Add vals unitNode.setAttribute('vals', utils.xml.mat2str(obj.vals)); % Add to parent node if appendChild parent.appendChild(unitNode); end end end end