AnsweredAssumed Answered

Using count within an XPath Query

Question asked by midgard on Apr 14, 2015

I'm trying to determine how many instances of a particular tag/element are returned from a database query, but the count() function doesn't seem to play well with Lisa's XPath Query component. On the database test step, I've added an XML XPath Filter, which via the XPath Query field the following produces/displays the proper XML: "/com.itko.lisa.jdbc.JDBCResultSetCache/rows/list/string/text()"  The problem arises when I also try to include something like "[count(//name)]" in an effort to get a return that shows how many times the "name" tag is used in the XML. e.g. "/com.itko.lisa.jdbc.JDBCResultSetCache/rows/list/string/text() [count(//name)]"


No syntactical variation of the count() function I've tried seems to work, and I didn't know if (a) Lisa's XPath Query component cant handle something like count, (b) there's another option I havent considered, or (c) my syntax is flawed. -Any ideas?



Dave Higgins