commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject [JXPATH] Formatting xpath syntax with Hashtable and iterators
Date Thu, 01 Aug 2002 20:01:08 GMT
Hi all,

I am trying to use the latest version of JxPath, and am having some trouble
understanding how iterators and lists are supported.  My java code (fully
expanded) is:
			String atpConc = data.getParameters().get( "atpConc"
			List masterPlates = (List) pageData.get(
"masterPlates" );
			Standard96WellPlate plate = null;
			for ( Iterator i = masterPlates.iterator();
i.hasNext();  ) {
				plate = (Standard96WellPlate);
				PlateWell plateWell = (PlateWell) plate.get(
0 );
				Reaction reaction = plateWell.getReaction();
				if ( reaction.getAtpConc().equals( new
BigDecimal( atpConc ) ) ) {

I am attempting to find a Standard96WellPlate whose first well has a
reaction with the property Atpconc = a passed in atpConc.  My xPath
expression is:
Standard96WellPlate plate = (Standard96WellPlate) JXPathContext.newContext(
masterPlates ).
			   getValue( "well[1]/reaction/[atpConc='10']/" );

However, I keep generating errors about the syntax after
well[1]/reaction/....  I think my problem is that I don't have the properly
xpath for find my first plate in the list of masterPlates...  And I am not
properly return a Standard96WellPlate, but something else....


To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message