Mercurial > hg > ltpda
view m-toolbox/classes/+utils/@xml/getStruct.m @ 51:9d5c88356247 database-connection-manager
Make unit tests database connection parameters configurable
author | Daniele Nicolodi <nicolodi@science.unitn.it> |
---|---|
date | Wed, 07 Dec 2011 17:24:37 +0100 |
parents | f0afece42f48 |
children |
line wrap: on
line source
function objs = getStruct(node, inhists) % Get shape objShape = sscanf(utils.xml.mchar(node.getAttribute('structShape')), '%dx%d')'; if any(objShape==0) objs = struct([]); objs = reshape(objs, objShape); else objs = []; % Loop over all structure nodes for jj = 1:node.getLength() structNode = node.item(jj-1); if structNode.getNodeType == structNode.ELEMENT_NODE obj = struct(); % Loop over all fieldnames for ff = 1:structNode.getLength() fieldnameNode = structNode.item(ff-1); if fieldnameNode.getNodeType == fieldnameNode.ELEMENT_NODE fname = utils.xml.mchar(fieldnameNode.getNodeName()); obj.(fname) = utils.xml.getFromType(fieldnameNode, inhists); end end objs = [objs obj]; end end objs = reshape(objs, objShape); end end