Mercurial > hg > ltpda
diff m-toolbox/classes/@ltpda_uo/fromDom.m @ 0:f0afece42f48
Import.
author | Daniele Nicolodi <nicolodi@science.unitn.it> |
---|---|
date | Wed, 23 Nov 2011 19:22:13 +0100 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/m-toolbox/classes/@ltpda_uo/fromDom.m Wed Nov 23 19:22:13 2011 +0100 @@ -0,0 +1,33 @@ + +function fromDom(obj, node, inhists) + + %%%%%%%%%% Call super-class + + fromDom@ltpda_obj(obj, node, inhists); + + %%%%%%%%%% Get properties from the node attributes + + % Get UUID + obj.UUID = utils.xml.mchar(node.getAttribute('UUID')); + + %%%%%%%%%% Get properties from the child nodes + + % Get name + childNode = utils.xml.getChildByName(node, 'name'); + if ~isempty(childNode) + obj.name = utils.xml.getString(childNode); + end + + % Get description + childNode = utils.xml.getChildByName(node, 'description'); + if ~isempty(childNode) + obj.description = utils.xml.getString(childNode); + end + + % Get mdlfile + childNode = utils.xml.getChildByName(node, 'mdlfile'); + if ~isempty(childNode) + obj.mdlfile = utils.xml.getString(childNode); + end + +end