Mercurial > hg > ltpda
annotate m-toolbox/classes/+utils/@xml/getChildByName.m @ 31:a26669b59d7e database-connection-manager
Update LTPDAworkbench
author | Daniele Nicolodi <nicolodi@science.unitn.it> |
---|---|
date | Mon, 05 Dec 2011 16:20:06 +0100 |
parents | f0afece42f48 |
children |
rev | line source |
---|---|
0 | 1 |
2 function result = getChildByName(node, childName) | |
3 | |
4 persistent FACTORY | |
5 persistent XPATH | |
6 | |
7 if isempty(FACTORY) | |
8 FACTORY = javax.xml.xpath.XPathFactory.newInstance(); | |
9 end | |
10 if isempty(XPATH) | |
11 XPATH = FACTORY.newXPath(); | |
12 end | |
13 | |
14 expression = XPATH.compile(sprintf('child::%s', childName)); | |
15 result = expression.evaluate(node, javax.xml.xpath.XPathConstants.NODE); | |
16 | |
17 end |