Mercurial > hg > ltpda
view m-toolbox/classes/+utils/@xml/getChildrenByName.m @ 43:bc767aaa99a8
CVS Update
author | Daniele Nicolodi <nicolodi@science.unitn.it> |
---|---|
date | Tue, 06 Dec 2011 11:09:25 +0100 |
parents | f0afece42f48 |
children |
line wrap: on
line source
function result = getChildrenByName(node, childName) persistent FACTORY persistent XPATH if isempty(FACTORY) FACTORY = javax.xml.xpath.XPathFactory.newInstance(); end if isempty(XPATH) XPATH = FACTORY.newXPath(); end expression = XPATH.compile(sprintf('child::%s', childName)); result = expression.evaluate(node, javax.xml.xpath.XPathConstants.NODESET); end