commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dmitri Plotnikov <dplot...@yahoo.com>
Subject Re: [JXPATH] Formatting xpath syntax with Hashtable and iterators
Date Thu, 01 Aug 2002 20:47:09 GMT
Your XPath does indeed have a syntax problem. There should be no slash
before the predicate.  If I understand your requirement correctly, the
correct syntax is:

"well[reaction/atpConc='10']" 

I hope this helps,

- Dmitri


--- EPugh@upstate.com wrote:
> 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) i.next();
> 				PlateWell plateWell = (PlateWell) plate.get(
> 0 );
> 				Reaction reaction = plateWell.getReaction();
> 				if ( reaction.getAtpConc().equals( new
> BigDecimal( atpConc ) ) ) {
> 					break;
> 				}
> 			}
> 
> 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....
> 
> Thanks,
> Eric
> 
> --
> To unsubscribe, e-mail:  
> <mailto:commons-dev-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
> <mailto:commons-dev-help@jakarta.apache.org>
> 


__________________________________________________
Do You Yahoo!?
Yahoo! Health - Feel better, live better
http://health.yahoo.com

--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message